[Bug c/25533] New: pthread_attr_setstacksize does not set the proper size

2005-12-22 Thread ochem at gnat dot com
It seems that on ia64, the function pthread_create does not use the value of
pthread_attr_setstacksize for the stack size, but something like the half of
it. The reproducer attached tries to fill the stack according to its supposed
size, and show that we are actually able to fill only half of it before getting
a segv.

gcc -g bug.c -o bug

gdb bug
(gdb) run 200 190

you should get something like:

7arr [i] = 0xdeadbeef;
(gdb) print i * sizeof (int)
$2 = 904028  

So, although the given size of the stack is supposed to be something around
2Megs, there is less than 1Meg of stack where we can actually write.


-- 
   Summary: pthread_attr_setstacksize does not set the proper size
   Product: gcc
   Version: 3.4.6
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ochem at gnat dot com
  GCC host triplet: ia64-sgi-linux-gnu, ia64-hp-hpux11.23, ia64-hp-linux-gnu
GCC target triplet: ia64-sgi-linux-gnu, ia64-hp-hpux11.23, ia64-hp-linux-gnu


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



[Bug c/25533] pthread_attr_setstacksize does not set the proper size

2005-12-22 Thread ochem at gnat dot com


--- Comment #1 from ochem at gnat dot com  2005-12-22 13:38 ---
Created an attachment (id=10551)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10551&action=view)
Bug reproducer


-- 


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



[Bug other/20670] New: IA-64 exception mechanism erase $f29

2005-03-28 Thread ochem at gnat dot com
There is some strange behavihour about the register f29 (and may be the next 
floating registers) when an exception is raised. Its value is not properly 
loaded. Going into the sources of gcc, I found sth interresting there : 
 
unwind-ia64.c:2298:"(p7) ldf.fill f29 = [r27]  \n\t" 
 
before this assingment, $f29 has the right value. Since it hasn't be used (ie 
it wasn't saved by anything), as far as I understand, it shouldn't be modified 
here, but it is. My belief is that there is sth wrong with r27. Here is a 
little extract of the few lines above : 
 
2258: "ld8 r22 = [r20], 8 \n\t" 
2259: "(p6) ldf.fill f18 = [r24]  \n\t" 
2260: "cmp.ne p7, p0 = r0, r25\n\t" 
2261: ";; \n\t" 
2262: "ld8 r23 = [r20], 8 \n\t" 
2263: "(p7) ldf.fill f19 = [r25]  \n\t" 
2264: "cmp.ne p6, p0 = r0, r26\n\t" 
2265: ";; \n\t" 
2266: "ld8 r24 = [r20], 8 \n\t" 
2267: "(p6) ldf.fill f20 = [r26]  \n\t" 
2268: "cmp.ne p7, p0 = r0, r27\n\t" 
2269: ";; \n\t" 
2270: "ld8 r25 = [r20], 8 \n\t" 
2271: "(p7) ldf.fill f21 = [r27]  \n\t" 
2272: "cmp.ne p6, p0 = r0, r28\n\t" 
2273: ";; \n\t" 
2274: "ld8 r26 = [r20], 8 \n\t" 
2275: "(p6) ldf.fill f22 = [r28]  \n\t" 
2276: "cmp.ne p7, p0 = r0, r29\n\t" 
2277: ";; \n\t" 
2278: "ld8 r28 = [r20], 8 \n\t" 
2279: "(p7) ldf.fill f23 = [r29]  \n\t" 
2280: "cmp.ne p6, p0 = r0, r22\n\t" 
2281: ";; \n\t" 
2282: "ld8 r29 = [r20], 8 \n\t" 
2283: "(p6) ldf.fill f24 = [r22]  \n\t" 
2284: "cmp.ne p7, p0 = r0, r23\n\t" 
2285: ";; \n\t" 
2286: "(p7) ldf.fill f25 = [r23]  \n\t" 
2287: "cmp.ne p6, p0 = r0, r24\n\t" 
2288: "cmp.ne p7, p0 = r0, r25\n\t" 
2289: ";; \n\t" 
2290: "(p6) ldf.fill f26 = [r24]  \n\t" 
2291: "(p7) ldf.fill f27 = [r25]  \n\t" 
2292: "cmp.ne p6, p0 = r0, r26\n\t" 
2293: ";; \n\t" 
2294: "(p6) ldf.fill f28 = [r26]  \n\t" 
2295: "cmp.ne p7, p0 = r0, r27\n\t" 
2296: "cmp.ne p6, p0 = r0, r28\n\t" 
2297: ";; \n\t" 
2298: "(p7) ldf.fill f29 = [r27]  \n\t" 
 
As you see, r27 is used to fill the value of f21. Like r26 for f20, r25 for f19 
etc. But, while r25, r26, r28 and so are reloaded before filling the last float 
registers, r27 seems to be missing, so its value for f29 is the same as the one 
used for f21. The fix seems to be quite light, just add the proper load for r27 
at the right place.

-- 
   Summary: IA-64 exception mechanism erase $f29
   Product: gcc
   Version: 3.4.4
Status: UNCONFIRMED
  Severity: critical
  Priority: P2
 Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ochem at gnat dot com
CC: gcc-bugs at gcc dot gnu dot org,ochem at gnat dot com
 GCC build triplet: 3.4.4
  GCC host triplet: 3.4.4
GCC target triplet: 3.4.4


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


[Bug other/20670] IA-64 exception mechanism erase $f29

2005-03-28 Thread ochem at gnat dot com


-- 
   What|Removed |Added

   GCC host triplet|3.4.4   |ia-64


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


[Bug target/20670] IA-64 exception mechanism erase $f29

2005-03-30 Thread ochem at gnat dot com

--- Additional Comments From ochem at gnat dot com  2005-03-30 20:13 ---
The test case is ok, I get an abort if I compile it with -O2 option on a 3.4 
compiler. 

-- 


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