public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list
@ 2007-10-31 19:20 rjpeters at klab dot caltech dot edu
2007-11-16 15:03 ` [Bug c++/33962] " rob dot quill at gmail dot com
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: rjpeters at klab dot caltech dot edu @ 2007-10-31 19:20 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 4073 bytes --]
I ran across this ICE while compiling some old code that used to compile
cleanly with at least gcc 3.3.x and maybe 3.4.x. Looks like this ICE occurs in
a number of 4.x versions including 4.0.1 (Darwin), 4.1.1 (Mandriva Cooker
2007), 4.1.2 (Fedora Core 7), as well as current 4.3.0 mainline from svn.
$ /home/tmp/u/rjpeters/gcc-svn-install/bin/g++ -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /home/tmp/u/rjpeters/gcc-svn/configure
--prefix=/home/tmp/u/rjpeters/gcc-svn-install --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--enable-languages=c,c++ --enable-long-long --enable-checking
--with-gmp=/home/tmp/u/rjpeters/gmp-4.2.1-install
--with-mpfr=/home/tmp/u/rjpeters/mpfr-2.2.1-install
Thread model: posix
gcc version 4.3.0 20071031 (experimental) [trunk revision 129804] (GCC)
$ cat bug.C
template <class T> struct A;
template <class U> void foo(const U& x, ...);
template <class T> void foo(const A<T>& x, ...);
void bar(const A<int>& x, const char* y)
{
foo(x, y); // <--- ICE occurs here
}
$ /home/tmp/u/rjpeters/gcc-svn-install/bin/g++ -c bug.C
bug.C: In function void bar(const A<int>&, const char*):
bug.C:8: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
The code compiles cleanly when either the '...' is replaced with 'const char*',
or when one of the function overloads is removed.
Other compiler versions that give the same ICE:
$ g++ -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --enable-plugin
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070502 (Red Hat 4.1.2-12)
$ g++ -v
Using built-in specs.
Target: x86_64-mandriva-linux-gnu
Configured with: ../configure --prefix=/usr --libexecdir=/usr/lib
--with-slibdir=/lib64 --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --enable-checking=release
--enable-languages=c,c++,ada,fortran,objc,obj-c++,java
--host=x86_64-mandriva-linux-gnu --with-cpu=generic --with-system-zlib
--enable-long-long --enable-__cxa_atexit --enable-clocale=gnu
--disable-libunwind-exceptions --enable-java-awt=gtk
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --enable-gtk-cairo
--enable-ssp --disable-libssp
Thread model: posix
gcc version 4.1.1 20060724 (prerelease) (4.1.1-3mdk)
$ g++ -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5363.obj~28/src/configure
--disable-checking -enable-werror --prefix=/usr --mandir=/share/man
--enable-languages=c,objc,c++,obj-c++
--program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
--with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib
--build=powerpc-apple-darwin8 --with-arch=nocona --with-tune=generic
--program-prefix= --host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5363)
Thanks,
Rob Peters
--
Summary: ICE at call to overloaded template function with
variable-length function argument list
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rjpeters at klab dot caltech dot edu
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
@ 2007-11-16 15:03 ` rob dot quill at gmail dot com
2007-11-19 4:48 ` [Bug c++/33962] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rob dot quill at gmail dot com @ 2007-11-16 15:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rob dot quill at gmail dot com 2007-11-16 15:03 -------
Hey,
I can confirm this and am trying to investigate the problem. It seems that
more_specialized_fn() loops over the arguments to the first overloaded
function, where in this case there are two, but the tree chain describing the
parameters for the function only contains 1 (i.e. it doesn't count the
ellipses). My current solution just changes the value of len to be at most the
number of items in the chain.
However, I suspect that there is actually something else wrong and that there
should be another node in the chain of type TYPE_PACK_EXPANSION which describes
the variadic-ness of the function.
If anyone can clarify this for me that would be much appreciated.
Rob Quill.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2/4.3 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
2007-11-16 15:03 ` [Bug c++/33962] " rob dot quill at gmail dot com
@ 2007-11-19 4:48 ` pinskia at gcc dot gnu dot org
2007-11-19 11:12 ` jakub at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-11-19 4:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2007-11-19 04:47 -------
Confirmed.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-valid-code
Known to fail| |4.1.0
Known to work| |3.4.0
Last reconfirmed|0000-00-00 00:00:00 |2007-11-19 04:47:57
date| |
Summary|ICE at call to overloaded |[4.1/4.2/4.3 Regression] ICE
|template function with |at call to overloaded
|variable-length function |template function with
|argument list |variable-length function
| |argument list
Target Milestone|--- |4.2.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2/4.3 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
2007-11-16 15:03 ` [Bug c++/33962] " rob dot quill at gmail dot com
2007-11-19 4:48 ` [Bug c++/33962] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-11-19 11:12 ` jakub at gcc dot gnu dot org
2007-11-20 6:26 ` jakub at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-19 11:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2007-11-19 11:12 -------
Testing a fix.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2007-11-19 04:47:57 |2007-11-19 11:12:30
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2/4.3 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (2 preceding siblings ...)
2007-11-19 11:12 ` jakub at gcc dot gnu dot org
@ 2007-11-20 6:26 ` jakub at gcc dot gnu dot org
2007-11-20 6:40 ` [Bug c++/33962] [4.1/4.2 " jakub at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-20 6:26 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from jakub at gcc dot gnu dot org 2007-11-20 06:26 -------
Subject: Bug 33962
Author: jakub
Date: Tue Nov 20 06:26:11 2007
New Revision: 130308
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130308
Log:
PR c++/33962
* pt.c (more_specialized_fn): Don't segfault if one or
both argument list end with ellipsis.
* g++.dg/overload/template3.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/overload/template3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (3 preceding siblings ...)
2007-11-20 6:26 ` jakub at gcc dot gnu dot org
@ 2007-11-20 6:40 ` jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-20 6:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2007-11-20 06:39 -------
Fixed on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2/4.3 Regression] ICE|[4.1/4.2 Regression] ICE at
|at call to overloaded |call to overloaded template
|template function with |function with variable-
|variable-length function |length function argument
|argument list |list
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (4 preceding siblings ...)
2007-11-20 6:40 ` [Bug c++/33962] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-02-01 17:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jsm28 at gcc dot gnu dot org 2008-02-01 16:55 -------
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.3 |4.2.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.1/4.2 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (5 preceding siblings ...)
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
@ 2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
2008-07-04 22:53 ` [Bug c++/33962] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-31 0:36 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-19 20:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jsm28 at gcc dot gnu dot org 2008-05-19 20:23 -------
4.2.4 is being released, changing milestones to 4.2.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.4 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.2 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (6 preceding siblings ...)
2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
@ 2008-07-04 22:53 ` jsm28 at gcc dot gnu dot org
2009-03-31 0:36 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jsm28 at gcc dot gnu dot org 2008-07-04 22:52 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2 Regression] ICE at |[4.2 Regression] ICE at call
|call to overloaded template |to overloaded template
|function with variable- |function with variable-
|length function argument |length function argument
|list |list
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/33962] [4.2 Regression] ICE at call to overloaded template function with variable-length function argument list
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
` (7 preceding siblings ...)
2008-07-04 22:53 ` [Bug c++/33962] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-31 0:36 ` jsm28 at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-31 0:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jsm28 at gcc dot gnu dot org 2009-03-31 00:36 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|4.1.0 |4.1.0 4.2.5
Known to work|3.4.0 |3.4.0 4.3.0
Resolution| |FIXED
Target Milestone|4.2.5 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33962
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-03-31 0:36 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-31 19:20 [Bug c++/33962] New: ICE at call to overloaded template function with variable-length function argument list rjpeters at klab dot caltech dot edu
2007-11-16 15:03 ` [Bug c++/33962] " rob dot quill at gmail dot com
2007-11-19 4:48 ` [Bug c++/33962] [4.1/4.2/4.3 Regression] " pinskia at gcc dot gnu dot org
2007-11-19 11:12 ` jakub at gcc dot gnu dot org
2007-11-20 6:26 ` jakub at gcc dot gnu dot org
2007-11-20 6:40 ` [Bug c++/33962] [4.1/4.2 " jakub at gcc dot gnu dot org
2008-02-01 17:02 ` jsm28 at gcc dot gnu dot org
2008-05-19 20:30 ` jsm28 at gcc dot gnu dot org
2008-07-04 22:53 ` [Bug c++/33962] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-31 0:36 ` jsm28 at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).