Bug#187564: [Bug target/10692] [3.3/3.4 regression] [m68k] miscompilation of perl with -O2 -fPIC
------- Additional Comments From schwab at suse dot de 2004-01-11 21:52 -------
The miscompilation happens here:
yearday %= (4*365 +1);
With -fregmove, this is generated:
move.l %d3,%d1 | yearday, tmp264
muls.l #376287347,%d0:%d1 |, tmp262, tmp264
asr.l #7,%d0 |, tmp262
move.l %d3,%d1 | yearday, tmp266
add.l %d1,%d1 | tmp266
subx.l %d1,%d1 | tmp266
sub.l %d1,%d0 | tmp266, tmp262
lea (%a1,%d0.l*4),%a1 |, year
move.l %d0,%a0 | tmp262,
lea (%a0,%d0.l*8),%a0 |,
move.l %a0,%d1 |, tmp276
move.l %d0,%a0 | tmp262,
lea (%a0,%d1.l*8),%a0 |,
---> lea (%a0,%d1.l*4),%a0 |,
move.l %a0,%d1 |, tmp280
move.l %d0,%a0 | tmp262,
lea (%a0,%d1.l*4),%a0 |,
sub.l %a0,%d3 | tmp282, yearday
With -fno-regmove, this is generated:
move.l %d3,%d1 | yearday, tmp264
muls.l #376287347,%d0:%d1 |, tmp263, tmp264
asr.l #7,%d0 |, tmp265
move.l %d3,%d1 | yearday, tmp266
add.l %d1,%d1 | tmp266
subx.l %d1,%d1 | tmp266
move.l %d0,%a1 | tmp265, tmp262
sub.l %d1,%a1 | tmp266, tmp262
lea (%a3,%a1.l*4),%a3 |, year
lea (%a1,%a1.l*8),%a0 |, tmp276
lea (%a1,%a0.l*8),%a0 |, tmp278
---> lea (%a0,%a0.l*4),%a0 |, tmp280
lea (%a1,%a0.l*4),%a0 |, tmp282
sub.l %a0,%d3 | tmp282, yearday
(much more compact, btw.)
The real difference is in the marked lines, they should be identical.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |schwab at suse dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10692
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
Reply to: