miscompilation with conditional operator side effects (ARM64)

Bug #1474304 reported by Роман Донченко
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.9 (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ 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.

Revision history for this message
Роман Донченко (dpb-r) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.