IPA-SRA changes DECL_ASSEMBLER_NAME by changing the function signature before
mangling which results in collisions (testcase reduced from OpenOffice):
class A {};
class B {};
static void *func (int n)
{
void *p;
if (p == 0) throw ::A ();
}
static void *func (int n, B const &)
{
try {
return func (n);
}
catch (::A const &) {
}
return func (n);
}
void *f1 (int n)
{
return func (n, B());
}
void *f2 (int n)
{
return func (n, B());
}
> g++-4.5 -c t.C -O2
/tmp/ccav9PrN.s: Assembler messages:
/tmp/ccav9PrN.s:21: Error: symbol `_ZL4funcv' is already defined
--
Summary: [4.5 Regression] IPA-SRA changes DECL_ASSEMBLER_NAME
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43257