I tried to emerge kde-base/arts-3.5.9 with gcc-4.3.1 and ‘-fipa-pta’ in CXXFLAGS. This resulted in an ICE for mcopidl/mcopidl.all_cc.cc. I’m going to attach my reduced testcase.
Created attachment 158553 [details] Preprocessed source with reduced testcase for showing gcc-4.3.1 -fipa-pta ICE. Reduced testcase. Compile with LC_ALL=POSIX g++ -O0 -march=i686 -fipa-pta -c testcase.ii -v Output on my machine: Using built-in specs. Target: i686-pc-linux-gnu Configured with: /var/tmp/portage/sys-devel/gcc-4.3.1/work/gcc-4.3.1/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.1 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.1/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.1/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-cld --enable-java-awt=gtk --with-arch=i686 --enable-objc-gc --enable-languages=c,c++,java,objc,obj-c++,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.1 p1.0' Thread model: posix gcc version 4.3.1 (Gentoo 4.3.1 p1.0) COLLECT_GCC_OPTIONS='-O0' '-march=i686' '-fipa-pta' '-c' '-v' '-shared-libgcc' /usr/libexec/gcc/i686-pc-linux-gnu/4.3.1/cc1plus -fpreprocessed testcase.ii -quiet -dumpbase testcase.ii -march=i686 -auxbase testcase -O0 -version -fipa-pta -o /tmp/ccUvy6uF.s GNU C++ (Gentoo 4.3.1 p1.0) version 4.3.1 (i686-pc-linux-gnu) compiled by GNU C version 4.3.1, GMP version 4.2.2, MPFR version 2.3.1. GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=128247 Compiler executable checksum: 769715287e8864c7a73a39affa8c1337 testcase.ii: In function 'void foo(const char*)': testcase.ii:6: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <http://bugs.gentoo.org/> for instructions.
This bug may look similar to bug 228889, but I think it is different, because a) it goes away if ‘-O2’ is used instead of ‘-O0’, b) it goes away if ‘strdup’ in the test code is replaced by ‘hello’, for example (I assume this is related to the internal accelerated strdup function from GCC), c) it is only triggered when using the C++ compiler (g++), not when using the C compiler: ln -s testcase.ii testcase.i LC_ALL=POSIX gcc -O0 -march=i686 -fipa-pta -c testcase.i -v # Result: works fine, no ICE. This issue has not yet been reported upstream. Feel free to do so if you can reproduce it. Thanks!
i think it is the same as it seems that it is the display of a warning message that causes the ICE ... but i havent dug into the gcc source code to be sure, so we'll just leave this open
-fipa-pta doesnt affect code generation, so it doesnt make sense to use it. upstream is aware of the issues though and is banging away on them.