Public bug reported:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:        15.04
Codename:       vivid

$ gcc --version
gcc (Ubuntu/Linaro 4.9.2-10ubuntu13) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gcc -dumpmachine
aarch64-linux-gnu

$ gcc -O0 -std=c11 repro.c ; ./a.out ; echo $? # repro.c attached
0

$ gcc -O2 -std=c11 repro.c ; ./a.out ; echo $?
1

I don't think this program triggers any undefined behavior, so the
optimized version is miscompiled.

I wasn't able to reproduce this with with vanilla 4.9.2.

** Affects: gcc-4.9 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "program exhibiting the bug"
   https://bugs.launchpad.net/bugs/1474304/+attachment/4428649/+files/repro.c

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1474304

Title:
  miscompilation with conditional operator side effects (ARM64)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.9/+bug/1474304/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to