Ok, now got a simple sample. it seems that using -O2 causes the frame pointer to be off. compile with gcc -O2 -g tstparm.c tstparm2.c using "gdb a.out" u can either step trace ( display/i $pc & then si ), or just "r" and show the back trace a -02 build has this back trace. the variable lineAddr should have 0x1000000007 in it =========================================================== $ gdb a.out GNU gdb 19991004 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-redhat-linux"... (gdb) r Starting program: /gat/alinux-java/build/solaris/a.out Program received signal SIGSEGV, Segmentation fault. foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002, xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005, dstData=0x200003a5408 " h\025", lineAddr=0x200003aaa48, dstYStride=1, srcYStride=1299556) at /tmp/tstparm2.c:35 35 foo_s32 yFinish = sides[1]; (gdb) where #0 foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002, xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005, dstData=0x200003a5408 " h\025", lineAddr=0x200003aaa48, dstYStride=1, srcYStride=1299556) at /tmp/tstparm2.c:35 #1 0x12000044c in main () at /tmp/tstparm.c:37 ===================================================================== and gcc -O1 -g produces this ====================================================================== gdb a.out GNU gdb 19991004 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "alpha-redhat-linux"... (gdb) r Starting program: /gat/alinux-java/build/solaris/a.out Program received signal SIGSEGV, Segmentation fault. foo_4ch_bl (leftEdges=0x1000000001, rightEdges=0x1000000002, xStarts=0x1000000003, yStarts=0x1000000004, sides=0x1000000005, dstData=0x1000000006
, lineAddr=0x1000000007, dstYStride=268435464, srcYStride=268435465) at /tmp/tstparm2.c:35 35 foo_s32 yFinish = sides[1]; Michal Jaegermann wrote: > Uncle George wrote: > > > > It seems like the egcs compiler in redhat/6.2 is producing bad stack > > addressing. In my case it appears to be off by 16 bytes, and fetches the > > 7th arg from the wrong place( short by 16 bytes in fact ). > > I, for one, would be really interested in seeing a sample code which > would demonstrate that. I have seen in the past wrong offsets but they > were results of bugs in sources.