public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32
@ 2012-03-01  2:51 howarth at nitro dot med.uc.edu
  2012-12-15 14:02 ` [Bug c/52444] " howarth at nitro dot med.uc.edu
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-03-01  2:51 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52444
           Summary: gcc.dg/tree-prof/pr44777.c execution,
                    -fprofile-generate -D_PROFILE_GENERATE fails at -m32
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: howarth@nitro.med.uc.edu


On x86_64-apple-darwin11, the -m32 test case...

FAIL: gcc.dg/tree-prof/pr44777.c execution,    -fprofile-generate
-D_PROFILE_GENERATE
UNRESOLVED: gcc.dg/tree-prof/pr44777.c compilation,  -fprofile-use
-D_PROFILE_USE

This appears in gdb as...

# ./pr44777.x01
Segmentation fault
[prrg4:gcc/testsuite/gcc] root# gdb ./pr44777.x01
GNU gdb 6.3.50-20050815 (Apple version gdb-1752) (Sat Jan 28 03:02:46 UTC 2012)
Copyright 2004 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 "x86_64-apple-darwin"...Reading symbols for shared
libraries ... done

(gdb) r
Starting program:
/sw/src/fink.build/gcc47-4.7.0-1/darwin_objdir/gcc/testsuite/gcc/pr44777.x01 
Reading symbols for shared libraries ++........................ done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xad31d668
0x00013742 in __subtf3 (a=<invalid float value>, b=<invalid float value>) at
../../../../gcc-4.7-20120228/libgcc/soft-fp/subtf3.c:44
44      FP_SUB_Q(R, A, B);
(gdb) bt
#0  0x00013742 in __subtf3 (a=<invalid float value>, b=<invalid float value>)
at ../../../../gcc-4.7-20120228/libgcc/soft-fp/subtf3.c:44
#1  0x646a626f in ?? ()
(gdb)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/52444] gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32
  2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
@ 2012-12-15 14:02 ` howarth at nitro dot med.uc.edu
  2012-12-15 14:15 ` howarth at nitro dot med.uc.edu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-12-15 14:02 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-12-15 14:02:23 UTC ---
This issue doesn't occur under darwin10 but when object files, created under
darwin10, are linked under darwin12 this runtime failure occurs. I opened
radar://12875171 in case this was a darwin linker bug. The darwin linker
developer looked at this crash and had the following comments...

This is a (gcc) compiler bug.  The crash is because register EBX is wrong in
function x() after returning from the call to function y().  Function y() has
some fancy jumps to labels.  After recursing 1000 times, it returns but does so
via messing with the stack frame:

LM6:
        movl    %ecx, %eax
        leal    L5-L00000000001$pb(%ebx), %edx
        movl    (%eax), %ebp
        movl    4(%eax), %esp
        jmp         *%edx

This code does not restore EBX.  On runtimes in which EBX is the same for all
functions (e.g pointer to GOT), not restoring EBX will work.  But on Mac OS X,
EBX is different in every function.  Once it is trashed upon returning to x(),
x stores some memory values via EBX.  It is doing the stores to the wrong
location, causing a later crash.

It worked with the SL linker by luck.  The smashers happened to be written to
non-critical areas (__gcov_var).


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/52444] gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32
  2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
  2012-12-15 14:02 ` [Bug c/52444] " howarth at nitro dot med.uc.edu
@ 2012-12-15 14:15 ` howarth at nitro dot med.uc.edu
  2012-12-15 14:17 ` howarth at nitro dot med.uc.edu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-12-15 14:15 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-12-15 14:15:20 UTC ---
Created attachment 28977
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28977
assembly file for gcc.dg/tree-prof/pr44777.c -fprofile-generate
-D_PROFILE_GENERATE on x86_64-apple-darwin12

Generated with...

/sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/gcc/xgcc
-B/sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/gcc/
/sw/src/fink.build/gcc48-4.8.0-1000/gcc-4.8-20121214/gcc/testsuite/gcc.dg/tree-prof/pr44777.c
-fno-diagnostics-show-caret -O0 -fprofile-generate -D_PROFILE_GENERATE -lm -m32
-o
/sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/gcc/testsuite/gcc/pr44777.x01
--save-temps


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/52444] gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32
  2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
  2012-12-15 14:02 ` [Bug c/52444] " howarth at nitro dot med.uc.edu
  2012-12-15 14:15 ` howarth at nitro dot med.uc.edu
@ 2012-12-15 14:17 ` howarth at nitro dot med.uc.edu
  2012-12-15 14:23 ` howarth at nitro dot med.uc.edu
  2012-12-15 18:15 ` [Bug target/52444] non-local gotos are broken on x86 darwin pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-12-15 14:17 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-12-15 14:17:18 UTC ---
One interesting thing is that slightly different assembly is generated each
time you recompile this test case...

# diff -u pr44777.s pr44777.s.PROFILE_GENERATE
--- pr44777.s    2012-12-15 09:10:30.000000000 -0500
+++ pr44777.s.PROFILE_GENERATE    2012-12-15 09:08:44.000000000 -0500
@@ -262,7 +262,7 @@
 LPBX0:
     .long    875575397
     .long    0
-    .long    -1629035081
+    .long    -1629140997
     .long    LC0
     .long    ___gcov_merge_add
     .long    0

--- pr44777.s    2012-12-15 09:11:23.000000000 -0500+++
pr44777.s.PROFILE_GENERATE    2012-12-15 09:08:44.000000000 -0500
@@ -262,7 +262,7 @@
 LPBX0:
     .long    875575397
     .long    0
-    .long    -1628981943
+    .long    -1629140997
     .long    LC0
     .long    ___gcov_merge_add
     .long    0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c/52444] gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32
  2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
                   ` (2 preceding siblings ...)
  2012-12-15 14:17 ` howarth at nitro dot med.uc.edu
@ 2012-12-15 14:23 ` howarth at nitro dot med.uc.edu
  2012-12-15 18:15 ` [Bug target/52444] non-local gotos are broken on x86 darwin pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2012-12-15 14:23 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jack Howarth <howarth at nitro dot med.uc.edu> 2012-12-15 14:23:17 UTC ---
I see the same behavior on x86_64 Fedora linux...

/home/howarth/work-gcc/gcc/xgcc -B/home/howarth/work-gcc/gcc/
/home/howarth/gcc/gcc/testsuite/gcc.dg/tree-prof/pr44777.c 
-fno-diagnostics-show-caret   -O0 -fprofile-generate -D_PROFILE_GENERATE  -lm  
-m32 -o /home/howarth/work-gcc/gcc/testsuite/gcc/pr44777.x01 --save-temps

with slightly different assembly generated in each compilation...

--- pr44777.s.orig    2012-12-15 09:40:32.507293659 -0500
+++ pr44777.s    2012-12-15 09:40:45.323922586 -0500
@@ -250,7 +250,7 @@
 .LPBX0:
     .long    875575397
     .long    0
-    .long    -1627233075
+    .long    -1627220258
     .long    .LC0
     .long    __gcov_merge_add
     .long    0


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/52444] non-local gotos are broken on x86 darwin
  2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
                   ` (3 preceding siblings ...)
  2012-12-15 14:23 ` howarth at nitro dot med.uc.edu
@ 2012-12-15 18:15 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-12-15 18:15 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c                           |target
         Resolution|                            |DUPLICATE
            Summary|gcc.dg/tree-prof/pr44777.c  |non-local gotos are broken
                   |execution,                  |on x86 darwin
                   |-fprofile-generate          |
                   |-D_PROFILE_GENERATE fails   |
                   |at -m32                     |

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-12-15 18:15:24 UTC ---
Actually this was already filed as bug 51784 which has all the right
information about what is going on.  Again this is non-local gotos are broken
for x86 darwin.

*** This bug has been marked as a duplicate of bug 51784 ***


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-12-15 18:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-01  2:51 [Bug c/52444] New: gcc.dg/tree-prof/pr44777.c execution, -fprofile-generate -D_PROFILE_GENERATE fails at -m32 howarth at nitro dot med.uc.edu
2012-12-15 14:02 ` [Bug c/52444] " howarth at nitro dot med.uc.edu
2012-12-15 14:15 ` howarth at nitro dot med.uc.edu
2012-12-15 14:17 ` howarth at nitro dot med.uc.edu
2012-12-15 14:23 ` howarth at nitro dot med.uc.edu
2012-12-15 18:15 ` [Bug target/52444] non-local gotos are broken on x86 darwin pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).