This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/9941] [non-weak] typeinfo not generated correctly when #pragmas are involved
- From: "wolfgang dot glas at ev-i dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2003 18:23:07 -0000
- Subject: [Bug c++/9941] [non-weak] typeinfo not generated correctly when #pragmas are involved
- References: <20030304160600.9941.struppi@acm.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From wolfgang dot glas at ev-i dot at 2003-12-18 18:23 -------
Ok, unfortunately I was unable to contruct a simpler test case than the
original poster. However, I'd say that his testcase LS.tar.gz is already quite
minimal.
I revisited this test case on my AIX-5.1.0.0 machine using gcc-3.3 and snipped
the assembler listing of the typeinfo instance of class LS, which has been
emitted by gcc -s.
The first version is the original example of the poster, which includes a
std::vector<int> member in class LM.
So summing up, I would decalre this bug a regression against gcc-2.95, with me
failing to contruct an example without std::vector. I tried to replace
std::vector with a simple minimal template class but failed to reproduce the
bug.
TIA to anyone who could assist in solving this problem.
------------AIX assembler listing---------------
_ZTI2LS:
.long _ZTVN10__cxxabiv117__class_type_infoE+8
.long _ZTS2LS[RW]
.align 2
.globl _GLOBAL__F__ZN2LSC2Ev
_GLOBAL__F__ZN2LSC2Ev:
----------end of AIX assembler listing---------------
Here the typeinfo instance (_ZTI2LS) refers the typeinfo name (a symbol which
should carry the char pointer to the type name, which is "2LS" in this case),
but this symbol is never generated, which causes the linker error
unresolved symbol 'typeinfo name class xxxx'
for more complex programs, which involve templates and #pragma interface/
#pragma implementation.
As the original poster suggested, I replaced the std::vector<int> by a simple
int and snipped the assemvbler listing of the generated typeinfo instance.
------------AIX assembler listing---------------
_ZTI2LS:
.long _ZTVN10__cxxabiv117__class_type_infoE+8
.long _ZTS2LS
.csect _LS.rw_cc[RO],3
.align 2
_ZTS2LS:
.byte "2LS"
.byte 0
.csect .data[RW],3
.align 2
.globl _GLOBAL__F__ZN2LSC2Ev
_GLOBAL__F__ZN2LSC2Ev:
----------end of AIX assembler listing---------------
Here, the typeinfo correctly refers the generated typeinfo name _ZTS2LS, which
contains the string "2LS" as expected.
Unfortunately, I don't have a gcc-2.95 installation on a non-wek architecture
around, but I definitely compiled and linked more complex programs, which show
the above mentioned linker error, successfully using gcc-2.95 under AIX-4.3.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9941