This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/20024] [4.0 regression] miscompilation of division support functions


------- Additional Comments From hp at gcc dot gnu dot org  2005-02-17 10:23 -------
Here's the faulty program flow for the __Div call for
gcc.c-torture/execute/20010222-1.c -O0.
(-72 / 12; -72 in R10, 12 in R11; R10 holds the return value which should be
-6, not 0):

ffffffb8        c        6 ffffffb8           30 >    __Div
000176                subq 4,sp
000178 {sp-=4}        movem r0,[sp]
00017a                move.d r10,r0
00017c {r0=ffffffb8}  xor r11,r0
00017e {r0=ffffffb4}  abs r10,r12
000180 {r12=48}       blt 0x19a:__Div+0x24
000182                abs r11,r11
000184                clear.d r9
000186 {r9=0}         move.d r9,r10
000188 {r10=0}        add.d r9,r10
00018a                test.d r0
00018c                blt 0x194:__Div+0x1e
00018e                nop
000194                neg.d r10,r10
000196                ret
000198                movem [sp+],r0

Ask if there's clarification needed.

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20024


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]