Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 34221 - gcc-3.2.3-r2: internal compiler error (templates-related)
Summary: gcc-3.2.3-r2: internal compiler error (templates-related)
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GCC Porting (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Please assign to toolchain
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-23 14:19 UTC by Ben Davis
Modified: 2004-09-23 18:57 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Preprocessed source (ccYCHr02.out,963.67 KB, text/plain)
2003-11-23 14:21 UTC, Ben Davis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Davis 2003-11-23 14:19:48 UTC
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
Comment 1 Ben Davis 2003-11-23 14:21:07 UTC
Created attachment 21183 [details]
Preprocessed source
Comment 2 Ben Davis 2003-11-23 14:35:22 UTC
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.
Comment 3 Alexander Gabert (RETIRED) gentoo-dev 2004-03-04 06:00:57 UTC
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
Comment 4 Ben Davis 2004-03-04 06:38:37 UTC
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.
Comment 5 SpanKY gentoo-dev 2004-04-18 22:39:20 UTC
if gcc-3.3.2 doesnt resolve this, please re-open
Comment 6 Ben Davis 2004-04-19 05:31:09 UTC
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.)
Comment 7 Joshua Kinard gentoo-dev 2004-05-28 18:23:53 UTC
Is this still an issue in 3.3.3-rX?
Comment 8 Alexander Gabert (RETIRED) gentoo-dev 2004-09-23 18:57:46 UTC
If you want it fixed, open a gcc bug at gcc.gnu.org, closing it now.