https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69697

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egallager at gcc dot gnu.org

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #1)
> Confirming.  To make things worse, the program output changes between -O0
> and -O1:
> 
> $ (for o in 0 1 2 3; do gcc  -O$o -Wall -Wextra y.C && ./a.out; done)
> i = 0, j = 3, a = { 2, { 3, 4, } }
> i = 3, j = 0, a = { 2, { 3, 4, } }
> i = 3, j = 0, a = { 2, { 3, 4, } }
> i = 3, j = 0, a = { 2, { 3, 4, } }

I tested some additional optimization levels; -O0 is still the only different
one:

$ (for o in 0 1 2 3 g s fast; do /usr/local/bin/gcc -O${o} -Wall -Wextra
-std=c++14 -xc++ -o 69697_O${o}.exe 69697.c && printf "./69697_O${o}.exe: " &&
./69697_O${o}.exe; done)
./69697_O0.exe: i = 0, j = 3, a = { 2, { 3, 4, } }
./69697_O1.exe: i = 3, j = 0, a = { 2, { 3, 4, } }
./69697_O2.exe: i = 3, j = 0, a = { 2, { 3, 4, } }
./69697_O3.exe: i = 3, j = 0, a = { 2, { 3, 4, } }
./69697_Og.exe: i = 3, j = 0, a = { 2, { 3, 4, } }
./69697_Os.exe: i = 3, j = 0, a = { 2, { 3, 4, } }
./69697_Ofast.exe: i = 3, j = 0, a = { 2, { 3, 4, } }

Reply via email to