Bug report: egcs1.1, -fPIC + templates problem

Stephan Deibel sdeibel@dsg.harvard.edu
Wed Nov 25 01:36:00 GMT 1998


Hi,

Attached is a short source file, command line w/ output, and .ii file for
a case that crashes egcs 1.1 with "g++: Internal compiler error: program
as got fatal signal 11".

The bug does not occur if the -fPIC option is removed so there is possibly
a code generation problem associated with that option (or a bug in
this version of as?).

I case it matters, note that system type is pentiumII and not pentiumpro
as reported by egcs below.  If you need any other info, please don't
hesitate to contact me at sdeibel@dsg.harvard.edu. 

I hope this is useful.  Thanks very much for your work on egcs.  It is
very much appreciated!

- Stephan

------------------------

Command line:
------------

tyranno ~/projects/WT[186]> gcc -v --save-temps -c -g -fPIC -c test.cpp -o
test.o
Reading specs from
/usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cpp -lang-c++
-v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91
-D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix
-D__linux -Asystem(posix) -D__EXCEPTIONS -g -Asystem(unix) -Acpu(i386)
-Amachine(i386) -Di386 -D__i386 -D__i386__ -Di686 -Dpentiumpro -D__i686
-D__i686__ -D__pentiumpro -D__pentiumpro__ -D__PIC__ -D__pic__ test.cpp
test.ii
GNU CPP version egcs-2.91.57 19980901 (egcs-1.1 release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include/g++
 /usr/local/include
 /usr/local/i686-pc-linux-gnulibc1/include
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/include
 /usr/include
End of search list.
 /usr/local/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/cc1plus
test.ii -quiet -dumpbase test.cc -g -version -fPIC -o test.s
GNU C++ version egcs-2.91.57 19980901 (egcs-1.1 release)
(i686-pc-linux-gnulibc1) compiled by GNU C version egcs-2.91.57 19980901
(egcs-1.1 release).
 as -V -Qy -o test.o test.s
GNU assembler version 2.7 (i586-unknown-linux), using BFD version 2.7.0.2
gcc: Internal compiler error: program as got fatal signal 11

Source file test.cpp:
--------------------

#include <map>
#include <string>

// Define a string to string mapping, use multimap from STL
typedef std::multimap<std::string, std::string> WTt_StrMap;

// Class to handle all communication with browser and all per-request
state
class WTC_Connection {
public:

  // Get value from form or GET parameters
  const char* GetFormValue(const char* key) throw (std::bad_alloc);

  WTt_StrMap fFormValueMap;
};

const char* WTC_Connection::GetFormValue(const char* key_ptr) throw 
(std::bad_alloc)
{
  WTt_StrMap::iterator i;

  std::string key(key_ptr);

  i = fFormValueMap.find(key);
  if ( i == fFormValueMap.end() )
    return NULL;
  else
    return i->second.c_str();

  return NULL;
}

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ii.gz
Type: application/x-gzip
Size: 27637 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19981125/db42a981/attachment.bin>


More information about the Gcc-bugs mailing list