------- Comment #6 from sparky at pld-linux dot org  2008-09-29 21:36 -------
I was trying to isolate the code which triggers this bug, but seems like the
code must be very complex to do so. Nevertheless I found exactly how the
resulting assembler code is broken.
Note: files gsignal.s and gsignal.s-non-inline are switched.

In file .s file with inlining, at line 15045 there's the conditional jump
corresponding to `if (!accumulator)' from original code, but the actual
comparison of the value and zero is nowhere near to be found.

15041         mr 7,31
15042         bl [EMAIL PROTECTED]
15043 .LBB1531:
15044 .LBB1532:
15045         .loc 1 2282 0
15046         beq- 3,.L1255     <--- missing: cmpwi 3,9,0
15047 .LVL1697:
15048 .LBE1532:
15049         .loc 1 2285 0
15050         lwz 9,116(1)


It looks like gcc thinks the comparison at line 14364 is enough. The code does
not do anything with cr3 along the path, but several external functions are
called, which AFAIR are allowed to change the value of cr3.

14360         .loc 1 2333 0
14361         lwz 9,28(22)
14362 .LVL1636:
14363         .loc 1 2334 0
14364         cmpwi 3,9,0
14365         .loc 1 2333 0
14366         stw 9,116(1)
14367 .LVL1637:
14368         .loc 1 2334 0
14369         beq- 3,.L1414


I was playing with newer glib2, so I'm not really sure about this file, but in
my case adding appropriate cmpwi 3,<reg>,0 instruction was enough to fix the
code.


-- 


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

Reply via email to