This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/12241] New: failure to emit typeinfo with optimization
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2003 21:47:38 -0000
- Subject: [Bug c++/12241] New: failure to emit typeinfo with optimization
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12241
Summary: failure to emit typeinfo with optimization
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: snyder at fnal dot gov
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
The typeinfo for class Ex below is not emitted at -O2 or above:
$ g++ -O2 -o x x.cc
/tmp/ccho1Q6s.o: In function `main':
/tmp/ccho1Q6s.o(.text+0x1b): undefined reference to `typeinfo for Ex'
collect2: ld returned 1 exit status
$
With -O1 or lower, the example links correctly.
Environment:
System: Linux karma 2.4.19-emp_2419p5a829i #1 Tue Sep 3 17:42:17 EST 2002 i686 i686 i386 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr/local/gcc --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77
How-To-Repeat:
Compile and link the following with -O2 or above.
The typeinfo for Ex is not emitted.
--------------------------------------------------------
class Ex { };
int main() {
throw Ex();
return 0;
}
--------------------------------------------------------