This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36107] New: weak constructor product unvalid asm
- From: "william dot fink at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 May 2008 11:55:58 -0000
- Subject: [Bug c++/36107] New: weak constructor product unvalid asm
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
When using __attribute__((weak)) on a constructor, the produced assembly file
contains an extra *INTERNAL* on the constructor declaration line.
- Here is my test code:
class Test {
public:
Test() __attribute__((weak));
};
int test() {
Test test;
}
- The compilation output:
$ g++ test.cc
/tmp/cchKRpYD.s: Assembler messages:
/tmp/cchKRpYD.s:22: Error: junk at end of line, first unrecognized character is
`*'
- The corresponding asm line 22:
.weak _ZN4TestC1Ev *INTERNAL*
I have tried this with and it does not work for:
- gcc (GCC) 4.3.0 (compiled from sources)
- gcc-4.2 (GCC) 4.2.1 (Ubuntu 4.2.1-5ubuntu4)
- gcc-4.1 (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
It works without problems with:
- gcc-3.4 (GCC) 3.4.6 (Ubuntu 3.4.6-6ubuntu2)
If I manually remove the '*INTERNAL*' from the asm file, it compiles correctly.
I found a similar old bug (6418) from the GCC3.04 version
--
Summary: weak constructor product unvalid asm
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: william dot fink at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36107