I have the gcc-3.2.3-r2 ebuild installed. My C++ code caused an internal compiler error. Output follows; preprocessed source will be attached in a moment. g++ -W -Wall -Wwrite-strings -Iinclude -g3 -c src/sample.cpp -o obj/sample.o src/sample.cpp: In member function `virtual SamplePlayer* Sample::getPlayer(MIDIState*)': src/sample.cpp:117: warning: unused parameter `MIDIState*midiState' include/sample.h: At global scope: include/sample.h: In instantiation of `void SamplePlayer::doResample(int, sample_t*&, int, int, int) [with int L = 0, int R = 0, int DIR = 1, F = SamplePlayer::InterpNoneF]': include/sample.h:109: instantiated from here include/sample.h:94: internal compiler error: in tsubst, at cp/pt.c:6739 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccYCHr02.out file, please attach this to your bugreport
Created attachment 21183 [details] Preprocessed source
The following information may be of use: The bug occurred when I changed the following two lines to use 'template<int STEP> class F' where they previously only used 'class F', but I only made the change in the sample.h file. template<int SC, int DC, int L, int R, int DIR, template<int STEP> class F> void doResample(sample_t *&buffer, int dt, int todo, int lastSample); template<int L, int R, int DIR, template<int STEP> class F> void doResample(int destChannels, sample_t *&buffer, int dt, int todo, int lastSample); Now that I have changed the corresponding lines in the sample.cpp file, the bug no longer comes up.
i think this would be interesting for UPSTREAM maintainers of gcc at GNU.org is there a specific package related to that bug or may we just file your test case upwards the toolchain? thanks, Alex
There is no specific package related to the bug, apart from potentially the gcc-3.2.3-r2 ebuild. The bug may be introduced by a patch applied by that ebuild, or it may be in GCC itself. I posted here because I knew it might be the former. I would guess the bug won't manifest itself with valid code. It only came up when my code was invalid. (Of course, an internal error is still a bug - and it took me a while to realise my code was invalid.) If you or someone else has already checked that the bug comes up with a "vanilla" GCC build (whatever that means), then yeah, send it upstream. Otherwise maybe send it upstream with a disclaimer stating that it has not been confirmed with vanilla GCC? You know better than me.
if gcc-3.3.2 doesnt resolve this, please re-open
Still doesn't work, I'm afraid. entheh@bnd25 entheh $ emerge -p gcc These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] sys-devel/gcc-3.3.2-r5 entheh@bnd25 tests $ gcc -v Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs Configured with: /var/tmp/portage/gcc-3.3.2-r5/work/gcc-3.3.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3/info --enable-shared --host=i686-pc-linux-gnu --target=i686-pc-linux-gnu --with-system-zlib --enable-languages=c,c++,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --enable-nls --without-included-gettext --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib --enable-interpreter --enable-java-awt=xlib --with-x --disable-multilib Thread model: posix gcc version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) entheh@bnd25 tests $ g++ -c thingy.ii include/sample.h: In instantiation of `void SamplePlayer::doResample(int, sample_t*&, int, int, int) [with int L = 0, int R = 0, int DIR = 1, F = SamplePlayer::InterpNoneF]': include/sample.h:109: instantiated from here include/sample.h:94: internal compiler error: in tsubst, at cp/pt.c:6742 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugs.gentoo.org/> for instructions. Preprocessed source stored into /tmp/ccNpCMXm.out file, please attach this to your bugreport (Not attaching it because the bug can be produced with the existing attachment.)
Is this still an issue in 3.3.3-rX?
If you want it fixed, open a gcc bug at gcc.gnu.org, closing it now.