This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/26514] New: Wrong assembler code with -fprofile-generate


Hello,

this is a quite mysterious bug, for several reasons.

There are two classes, which differ only in their name, and a few places, where
another
constant value is returned or another function is called. One of them succeeds
with g++-4.1.0
the other fails, when using -fprofile-generate.

g++ -g -O2 -fprofile-generate -frandom-seed=0  -I. -I/home/strieder/xssr/sys
-I/home/strieder/xssr/sys/xssr-gui   -DINLINE='inline' -DDO_INLINE 
-DQT_THREAD_SUPPORT  -c -o StringReductionOrderingSyllablePartialNTTBLeftImpl.o
/home/strieder/xssr/sys/StringReductionOrderingSyllablePartialNTTBLeftImpl.cc
/tmp/ccde2ont.s: Assembler messages:
/tmp/ccde2ont.s:77: Error: unrecognized symbol type ""
/tmp/ccde2ont.s:77: Error: junk at end of line, first unrecognized character is
`0'
/tmp/ccde2ont.s:78: Error: junk at end of line, first unrecognized character is
`0'
/tmp/ccde2ont.s:124: Error: expected comma after name `' in .size directive
/tmp/ccde2ont.s:142: Error: junk `static_initialization_and_destruction_0ii'
after expression

These are line 77, 78 and 124 in the assembler code for the failing file:

77:        .type   000000static_initialization_and_destruction_0ii, @function
78: 000000static_initialization_and_destruction_0ii:

124:        .size   000000static_initialization_and_destruction_0ii,
.-000000static_initialization_and_
destruction_0ii

These are line 77, 78 and 124 in the assembler code for the working file:

77:        .type   _Z41__static_initialization_and_destruction_0ii, @function
78: _Z41__static_initialization_and_destruction_0ii:

124:         .size   _Z41__static_initialization_and_destruction_0ii,
.-_Z41__static_initialization_and_
destruction_0ii

I cannot reproduce the problem with the preprocessed file created by g++ -v
-save-temps.
So I don't know what code to include, besides the full sources, which is a lot.
Both runs 
following succeed in that order.

g++ -v -save-temps -g -O2 -fprofile-generate -frandom-seed=0  -I.
-I/home/strieder/xssr/sys -I/home/strieder/xssr/sys/xssr-gui  
-DINLINE='inline' -DDO_INLINE  -DQT_THREAD_SUPPORT  -c -o
StringReductionOrderingSyllablePartialNTTBLeftImpl.o
/home/strieder/xssr/sys/StringReductionOrderingSyllablePartialNTTBLeftImpl.cc 

g++ -g -O2 -fprofile-generate -frandom-seed=0  -I. -I/home/strieder/xssr/sys
-I/home/strieder/xssr/sys/xssr-gui   -DINLINE='inline' -DDO_INLINE 
-DQT_THREAD_SUPPORT  -c -o StringReductionOrderingSyllablePartialNTTBLeftImpl.o
StringReductionOrderingSyllablePartialNTTBLeftImpl.ii 

Another detail to add:

g++-4.1.0-20060223, the last prerelease, shows an ICE on the file failing under
g++-4.1.0,
and works without problems on the similar file. I cannot tell, whether this is
related to the
problem above.

LANG=C g++ -g -O2 -fprofile-generate -frandom-seed=0  -I.
-I/home/strieder/xssr/sys -I/home/strieder/xssr/sys/xssr-gui  
-DINLINE='inline' -DDO_INLINE  -DQT_THREAD_SUPPORT  -S -o
StringReductionOrderingSyllablePartialNTTBLeftImpl.s
/home/strieder/xssr/sys/StringReductionOrderingSyllablePartialNTTBLeftImpl.cc
/home/strieder/xssr/sys/StringReductionOrderingSyllablePartialNTTBLeftImpl.cc:
In destructor
'Xs_StringReductionOrderingSyllablePartialNTTBLeftImpl::~Xs_StringReductionOrderingSyllablePartialNTTBLeftImpl()':
/home/strieder/xssr/sys/StringReductionOrderingSyllablePartialNTTBLeftImpl.cc:172:
internal compiler error: Segmentation fault

There are no problems with g++-4.0.2.

This seems all rather mysterious to me. Should I make a second bug report for
the ICE in the already obsolete prerelease?

Please feel free to contact me on this. I might be out of office occasionally
during the next
 weeks so don't hold your breath.

Bernd Strieder


-- 
           Summary: Wrong assembler code with -fprofile-generate
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: strieder at informatik dot uni-kl dot de
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]