------- Comment #19 from ubizjak at gmail dot com 2008-11-20 21:37 ------- Hm, rdx gets corrupted:
check2848va: .LFB0: .cfi_startproc movq %rsi, %rcx # tmp73, leaq 8(%rsp), %rax #, (+) movq %rdx, -40(%rsp) #, shrq $32, %rcx #, cmpl %esi, s2848(%rip) # tmp73, s2848.a >>> movq -80(%rsp), %rdx #, tmp74 movq %rax, -112(%rsp) #, <variable>.overflow_arg_area leaq -56(%rsp), %rax #, movq %rsi, -48(%rsp) #, movl $8, -120(%rsp) #, <variable>.gp_offset movq %rsi, -88(%rsp) # tmp70, movq %rax, -104(%rsp) #, <variable>.reg_save_area movq %rsi, -72(%rsp) # tmp73, arg movq %rdx, -64(%rsp) # tmp74, arg je .L4 #, addl $1, fails(%rip) #, fails .L4: cmpl %ecx, s2848+4(%rip) # arg$b$real, s2848.b setne %cl #, tmp79 (++) cmpl %edx, s2848+8(%rip) # arg$b$imag, s2848.b setne %al #, tmp82 orb %al, %cl # tmp82, tmp79 je .L6 #, addl $1, fails(%rip) #, fails rdx is saved at the point of (+), corrupted at ">>>" and this corrupted value is used at (++). The insn at ">>>" just falls in the insn stream from the sky, it is not present if "a" is changed to "unsigned long" in S2848 structure. In case when "a" is changed to "unsigned long", testcase works OK. The testcase also works when insn at ">>>" is removed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38151