[Bug target/34174] gcc produces erroneous asm for movdi
rask at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Wed Nov 21 15:41:00 GMT 2007
------- Comment #3 from rask at gcc dot gnu dot org 2007-11-21 15:40 -------
Created an attachment (id=14592)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14592&action=view)
patch v1 for GCC 4.3
Please use -dp when posting asm output because it makes it easier to see what
is going on. Please also state the compiler options needed to reproduce the
bug.
Anyway, confirmed on trunk with revision 130319 with -O0. It is the usual
problem of a target which defines movdi patterns when it shouldn't and the fix
is to just delete the crap, which the attached patch does. It even saves an
instruction.
Before (function foo):
...
ldi:32 a, r3 ; 13 movsi_internal/4 [length = 6]
ldi:8 #248, r1 ; 52 movsi_internal/1 [length = 2]
extsb r1 ; 53 extendqisi2 [length = 2]
addn fp, r1 ; 16 addsi_regs [length = 2]
ld @r1, r1 ; 74 movsi_internal/7 [length = 2]
mov r1, r2 ; 75 movsi_internal/5 [length = 2]
addn 4, r2 ; 76 addsi_small_int/1 [length = 2]
ld @r2, r2 ; 77 movsi_internal/7 [length = 2]
st r1, @r3 ; 78 movsi_internal/6 [length = 2]
mov r3, r0 ; 79 movsi_internal/5 [length = 2]
addn 4, r0 ; 80 addsi_small_int/1 [length = 2]
st r2, @r0 ; 81 movsi_internal/6 [length = 2]
...
After:
ldi:32 a, r3 ; 19 movsi_internal/4 [length = 6]
ldi:8 #248, r1 ; 77 movsi_internal/1 [length = 2]
extsb r1 ; 78 extendqisi2 [length = 2]
addn fp, r1 ; 22 addsi_regs [length = 2]
ld @r1, r2 ; 23 movsi_internal/7 [length = 2]
st r2, @r3 ; 24 movsi_internal/6 [length = 2]
mov r3, r2 ; 82 movsi_internal/5 [length = 2]
addn 4, r2 ; 26 addsi_small_int/1 [length = 2]
addn 4, r1 ; 28 addsi_small_int/1 [length = 2]
ld @r1, r1 ; 29 movsi_internal/7 [length = 2]
st r1, @r2 ; 30 movsi_internal/6 [length = 2]
Please try this patch with GCC 4.2.2. Also, do you happen to know of a
simulator for fr30?
--
rask at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rask at gcc dot gnu dot org
|dot org |
Status|UNCONFIRMED |ASSIGNED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34174
More information about the Gcc-bugs
mailing list