[Bug middle-end/37154] static inline function problem

2008-10-01 Thread sparky at pld-linux dot org


--- Comment #10 from sparky at pld-linux dot org  2008-10-01 15:29 ---
In that case the bug report is incorrect.

The problem lays in glibc, in function lroundl which does not save cr3.


-- 


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



[Bug middle-end/37154] static inline function problem

2008-10-01 Thread sparky at pld-linux dot org


--- Comment #11 from sparky at pld-linux dot org  2008-10-01 16:47 ---
Note: glibc problem have been detected and fixed already:
- bug: https://bugzilla.redhat.com/show_bug.cgi?id=450790
- fix: http://www.sourceware.org/ml/libc-hacker/2008-06/msg1.html


-- 


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



[Bug middle-end/37154] static inline function problem

2008-10-01 Thread pinskia at gcc dot gnu dot org


--- Comment #12 from pinskia at gcc dot gnu dot org  2008-10-01 17:11 
---
GCC is doing the correct thing.  Glibc is broken so closing as invalid as glibc
has already been fixed.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID


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



[Bug middle-end/37154] static inline function problem

2008-09-29 Thread sparky at pld-linux dot org


--- 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



[Bug middle-end/37154] static inline function problem

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #7 from pinskia at gcc dot gnu dot org  2008-09-29 21:40 ---
IIRC cr3 is a volatile conditional register.


-- 


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



[Bug middle-end/37154] static inline function problem

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #8 from pinskia at gcc dot gnu dot org  2008-09-29 21:44 ---
CR3 is a caller save register just like R31.


-- 


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



[Bug middle-end/37154] static inline function problem

2008-09-29 Thread pinskia at gcc dot gnu dot org


--- Comment #9 from pinskia at gcc dot gnu dot org  2008-09-29 21:45 ---
So maybe someone is violating the PPC ABI.


-- 


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



[Bug middle-end/37154] static inline function problem

2008-08-18 Thread pinskia at gcc dot gnu dot org


--- Comment #4 from pinskia at gcc dot gnu dot org  2008-08-18 21:11 ---
gdb claims that problem is at line 2285, variable accumulator is 0x0,

well with optimization, debugging info is not always fully correct.


-- 

pinskia at gcc dot gnu dot org changed:

   What|Removed |Added

  Component|c   |middle-end


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



[Bug middle-end/37154] static inline function problem

2008-08-18 Thread wrobell at pld-linux dot org


--- Comment #5 from wrobell at pld-linux dot org  2008-08-18 22:40 ---
(In reply to comment #4)
 gdb claims that problem is at line 2285, variable accumulator is 0x0,
 
 well with optimization, debugging info is not always fully correct.
 

i've changed function declaration again to 'static inline'
and inserted

printf('acc %d\n', accumulator);

just before line 2285.

i've got 'acc 0'. so it is really 0x0 and the condition at line 2282
is not evaluated properly (or was optimized out/whatever :)


-- 


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