This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ ice with ostringstream on x86 linux
- To: gcc-bugs at gcc dot gnu dot org
- Subject: g++ ice with ostringstream on x86 linux
- From: Jim Randall <jim at freedomintelligence dot com>
- Date: Fri, 15 Jun 2001 11:18:33 -0400
- Organization: as little as possible
hey there....
Sadly, I've bumped into an internal compiler error in gcc V3 on
some C++ code. Unfortunately it includes sstream and string, so I
couldn't get the .i file down very small. The trimmed .cpp file is
about 30 lines or so, though. Here's the stats:
gcc -v produces:
Reading specs from /home/jim/usr/lib/gcc-lib/i686-pc-linux-gnu/3.1/specs
Configured with: ./configure --prefix=/home/jim/usr : (reconfigured)
Thread model: single
gcc version 3.1 20010614 (experimental)
Reproduce with:
g++ ice.i
Compiler output:
ice.cpp: In function `void foo2()':
ice.cpp:28: Internal compiler error in genrtl_compound_stmt, at c-semantics.c:
678
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
The only option given when gcc was built was --prefix=/home/jim/usr.
The only patch I've done to the compiler was as tweak to get libstdc++
loading in crtstuff.c:
158c158
< #ifdef HAVE_GAS_HIDDEN
---
> #if 0 // JRR was defined( HAVE_GAS_HIDDEN )
When __dso_handle was declared hidden, the loader was having a hard time
finding it, and I was getting problems loading libstdc++-v3
The source on my machine is current as of midday, June 14th, and no
changes have been made to c-semantics.c since.
My system is SuSE 6.4, using the stock 2.2.14-SMP kernel, if that matters.
Please let me know if I can be of any help, or if I've missed anything.
Criticism for screwing up the bug report is also accepted :-)
Both gnatsweb and gccbug gave me grief, so this was the best I could do.
I can be contacted at jim@jointtechnology.com
At the end of this message I've included a copy of the unpreprocessed
source file if you want it. The preprocesed file is in the attachment,
compressed with gzip.
have fun.....
------- jim.
------ 8x cut here -------
#include <sstream>
#include <string>
using namespace std;
extern bool Lex2Maple( ostream &o );
extern void fn2( const char * );
void foo2( void )
{
ostringstream *tStrStream = NULL;
ostringstream hStream, fStream;
unsigned int i;
for( i = 0; i < 2; ++i ) {
switch( i ) {
case 0:
Lex2Maple(hStream);
tStrStream = &hStream;
break;
case 1:
Lex2Maple(fStream);
tStrStream = &fStream;
break;
}
string finalStr = tStrStream->str();
fn2( finalStr.c_str() );
}
}
ice.i.gz