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

             Bug #: 50035
           Summary: [4.7 Regression] FAIL: g++.dg/tree-prof/partition2.C
                    execution, -Os -fprofile-use at revision 176696 on
                    x86_64-apple-darwin10
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: domi...@lps.ens.fr
                CC: hjl.to...@gmail.com, r...@gcc.gnu.org
              Host: x86_64-apple-darwin10
            Target: x86_64-apple-darwin10
             Build: x86_64-apple-darwin10


Created attachment 24969
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24969
Working assembly

Since revision 176696, the execution of g++.dg/tree-prof/partition2.C with -m64
-Os -fprofile-use gives a segmentation fault on x86_64-apple-darwin10. The test
succeeds on powerpc-apple-darwin9.

The difference between the working and faulty assembly files is

--- partition2.s-176695p1    2011-08-10 11:45:45.000000000 +0200
+++ partition2.s-176696p1    2011-08-10 12:13:42.000000000 +0200
@@ -36,21 +36,18 @@ LEHB2:
     call    ___cxa_throw
 LEHE2:
 LVL1:
-L6:
-    jmp    L4
-L7:
-    jmp    L5
-    .section __TEXT,__text_cold,regular,pure_instructions
-___cold_sect_of_main:
 L4:
     movq    %rax, %rbp
+    jmp    L2
+    .section __TEXT,__text_cold,regular,pure_instructions
+___cold_sect_of_main:
+L2:
     movq    %rbx, %rdi
     call    ___cxa_free_exception
 LVL2:
     movq    %rbp, %rax
     jmp    L3
 L5:
-    jmp    L3
 L3:
 LM5:
     movq    %rax, %rdi
@@ -89,14 +86,14 @@ LLSDA0:
     .long L$set$2
     .set L$set$3,LEHE1-LEHB1
     .long L$set$3
-    .set L$set$4,L6-LFB0
+    .set L$set$4,L4-LFB0
     .long L$set$4
     .byte    0x3
     .set L$set$5,LEHB2-LFB0
     .long L$set$5
     .set L$set$6,LEHE2-LEHB2
     .long L$set$6
-    .set L$set$7,L7-LFB0
+    .set L$set$7,L5-LFB0
     .long L$set$7
     .byte    0x1
     .byte    0x1
@@ -308,7 +305,7 @@ Ldebug_info0:
     .long L$set$32
     .byte    0x8
     .byte    0x1
-    .ascii "GNU C++ 4.7.0 20110723 (experimental) [trunk revision 176695p1]\0"
+    .ascii "GNU C++ 4.7.0 20110723 (experimental) [trunk revision 176696p1]\0"
     .byte    0x4
     .ascii "partition2.C\0"
     .ascii "/Users/dominiq/Documents/Fortran/g95bench/win/f90/bug\0"

Note that on i686-pc-linux-gnu the compilation fails at revision 176696 (see
http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg02767.html) while the test
succeeds at revision 176688 (see
http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg02743.html ). The error is

Executing on host: /home/regress/tbox/native/build/gcc/testsuite/g++/../../g++
-B/home/regress/tbox/native/build/gcc/testsuite/g++/../../
/home/regress/tbox/svn-gcc/gcc/testsuite/g++.dg/tree-prof/partition2.C 
-nostdinc++
-I/home/regress/tbox/native/build/i686-pc-linux-gnu/libstdc++-v3/include/i686-pc-linux-gnu
-I/home/regress/tbox/native/build/i686-pc-linux-gnu/libstdc++-v3/include
-I/home/regress/tbox/svn-gcc/libstdc++-v3/libsupc++
-I/home/regress/tbox/svn-gcc/libstdc++-v3/include/backward
-I/home/regress/tbox/svn-gcc/libstdc++-v3/testsuite/util -fmessage-length=0 
-Os  -fnon-call-exceptions -freorder-blocks-and-partition -fprofile-use   
-L/home/regress/tbox/native/build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs 
-B/home/regress/tbox/native/build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs 
-L/home/regress/tbox/native/build/i686-pc-linux-gnu/./libstdc++-v3/src/.libs 
-lm   -o /home/regress/tbox/native/build/gcc/testsuite/g++/partition2.x62   
(timeout = 300)
/tmp/ccUB3whI.s: Assembler messages:
/tmp/ccUB3whI.s:95: Error: invalid sections for operation on `.L5' and `.LFB0'
compiler exited with status 1
output is:
/tmp/ccUB3whI.s: Assembler messages:
/tmp/ccUB3whI.s:95: Error: invalid sections for operation on `.L5' and `.LFB0'

FAIL: g++.dg/tree-prof/partition2.C compilation,  -Os  -fprofile-use
UNRESOLVED: g++.dg/tree-prof/partition2.C execution,    -Os  -fprofile-use

The same kind of failure can also be seen on x86_64-unknown-linux-gnu and
i686-pc-linux-gnu (see
http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg02770.html and
http://gcc.gnu.org/ml/gcc-testresults/2011-07/msg02765.html).

I have no idea if the failures on linux are due to the same origin than on
darwin and no easy access to regstrapping on linux. Feel free to open another
pr for linux!-)

This pr may also be related/duplicate of pr49972.

Reply via email to