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

--- Comment #4 from Jukka Suomela <jukka.suomela at aalto dot fi> ---
Created attachment 58271
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58271&action=edit
Another example, miscompiles with GCC 11 (-O3 -march=skylake)

Here is a minor variant of the theme. This variant seems to fail already on GCC
11 if I compile with -O3 -march=skylake.

Expected:

$ g++-11 -Wall -Wextra test.cc -O2 -march=skylake -o test && ./test
0.000000 0.000000
11.000000 22.000000
22.000000 44.000000

Unexpected:

$ g++-11 -Wall -Wextra test.cc -O3 -march=skylake -o test && ./test
0.000000 0.000000
11.000000 22.000000
11.000000 22.000000

This was with g++-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0 on x86_64-linux-gnu.
In godbolt.org GCC 11.1 seemed to be the first version where this behavior
started.

(Apologies if this should be a separate bug report. I posted this here, as I
suspect the bugs might be related.)

Reply via email to