When compiling the attached lll.ii file (from lll.c from the gfan maths package at http://www.math.tu-berlin.de/~jensen/software/gfan/gfan.html ) with g++ 4.5.0, I get the following error message: g++ -O2 lll.ii -c -o lll.o /tmp/ccRt1FUj.s: Assembler messages: /tmp/ccRt1FUj.s:5145: Error: symbol `_ZZN6MatrixIiEixEPiPP6VektorIiEiE19__PRETTY_FUNCTION__' is already defined The error is not triggered with -O1, but it is triggered with -O1 -fipa-sra. Looking at the generated .s, the problem appears to be that the same XXX__PRETTY_FUNCTION__ symbol is generated for both an operator[] and its const version. g++ -v: Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/local/gcc-4.5.0/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: /usr/local/gcc-4.5.0/src/gcc-4.5.0/configure --enable-languages=c,c++,fortran --with-gnu-as --with-gnu-as=/usr/local/binutils-2.20.1/bin/as --with-gnu-ld --with-ld=/usr/local/binutils-2.20.1/bin/ld --with-gmp=/usr/local/mpir-1.2.2 --with-mpfr=/usr/local/mpfr-2.4.2 --with-mpc=/usr/local/mpc-0.8.1 --prefix=/usr/local/gcc-4.5.0 Thread model: posix gcc version 4.5.0 (GCC)
Created attachment 20498 [details] preprocessed source file
Matrix<int>::operator[](int*, Vektor<int>**, int)::__PRETTY_FUNCTION__
Very reduced testcase: extern void sf ( __const char *); struct Matrix{ int operator[](int n){ sf ( __PRETTY_FUNCTION__); } int operator[](int n)const{ sf ( __PRETTY_FUNCTION__); } }; void calcmy(Matrix const &b, Matrix &c, int k){ b[k]; c[k]; }
local statics need to be mangled before SRA changes the function signature.
Mine
Patch submitted to the mailing list: http://gcc.gnu.org/ml/gcc-patches/2010-06/msg01146.html
Subject: Bug 43905 Author: jamborm Date: Wed Jun 16 12:21:56 2010 New Revision: 160832 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=160832 Log: 2010-06-16 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43905 * tree-sra.c: Include tree-inline.h. (create_abstract_origin): Removed. (modify_function): Version the call graph node instead of creating abstract origins and dealing with same_body aliases. * tree-sra.c (ipa_sra_preliminary_function_checks): Check whether the function is versionable. * Makefile.in (tree-sra.o): Add TREE_INLINE_H to dependencies. * testsuite/g++.dg/torture/pr43905.C: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr43905.C Modified: trunk/gcc/ChangeLog trunk/gcc/Makefile.in trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-sra.c
Fixed on the trunk.
4.5 patch submitted to the mailing list: http://gcc.gnu.org/ml/gcc-patches/2010-06/msg02896.html
Subject: Bug 43905 Author: jamborm Date: Wed Jun 30 13:26:17 2010 New Revision: 161604 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161604 Log: 2010-06-30 Martin Jambor <mjambor@suse.cz> PR tree-optimization/43905 * tree-sra.c (encountered_recursive_call): Removed with all its uses. (convert_callers): Do not handle recursive calls specially. (create_abstract_origin): Removed. (modify_function): Version the call graph node instead of creating abstract origins and dealing with same_body aliases. (ipa_sra_preliminary_function_checks): Check whether the function is versionable. * Makefile.in (tree-sra.o): Add TREE_INLINE_H to dependencies. * testsuite/g++.dg/torture/pr43905.C: New test. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/torture/pr43905.C Modified: branches/gcc-4_5-branch/gcc/ChangeLog branches/gcc-4_5-branch/gcc/Makefile.in branches/gcc-4_5-branch/gcc/testsuite/ChangeLog branches/gcc-4_5-branch/gcc/tree-sra.c
This is now fixed on both the trunk and the 4.5 branch.
*** Bug 260998 has been marked as a duplicate of this bug. *** Seen from the domain http://volichat.com Marked for reference. Resolved as fixed @bugzilla.