[Bug target/35659] [4.3/4.4 Regression] Miscompiled code with -O2 (but not with -O2 -funroll-loops) on ia64
------- Comment #18 from jakub at gcc dot gnu dot org 2008-06-26 08:01 -------
You can reproduce it with a cross compiler too.
Just use 4.3 branch (IMHO unrelated changes on the trunk made this bug latent)
and don't combine everything into the same file.
The #c12 program+routines have to be in one file, #c13 in a different one.
The latter is miscompiled, if you are on ia64, you can compile the former
with any optimization options, the latter with -O2, link, run.
If you have just a cross compiler, just compile the #c13 source and inspect the
assembly (look at ld4.a:
addl r41 = @ltoff(slate_#), r1
...
adds r14 = 60, r41
...
.mmi
mov r44 = r14
mov r50 = r15
mov r59 = r14
... ! Instructions that don't modify r44 nor r59, no labels
.mmi
ld4.a r18 = [r44] ! *r44 aka slate_.k is uninitialized here,
0x20202020
st4 [r59] = r14, -60 ! This stores 1 into slate_.k
adds r16 = 48, r41
and look at the *.compgotos dump that right before scheduling that slate_.k = 1
preceeded the prephitmp.78 (== r18) = slate_.k load, while after scheduling
it is the other way around. The alias set looks correct for both MEMs (4) and
MEM_EXPR/MEM_OFFSET etc. too, so IMHO if alias.c was asked if the two MEMs can
overlap, it would certainly say so.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35659
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
Reply to: