http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48755

           Summary: ICE in instantiate_type: conditional expression of
                    std::complex .real and .imag
           Product: gcc
           Version: 4.2.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: jth...@astro.indiana.edu


Created attachment 24091
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24091
preprocessed source code (gzipped)

ICE on invalid code:

% cat complex-conditional-real-imag-nofn.cc
#include <complex>

double foo(const std::complex<double> z, const bool real_flag)
{
return real_flag ? z.real : z.imag;
}
%

Note the missing () after real & imag.

Attempting to compile this with gcc 4.2.4 produces an ICE:

complex-conditional-real-imag-nofn.cc: In function 'double
foo(std::complex<double>, bool)':
complex-conditional-real-imag-nofn.cc:5: internal compiler error: in
instantiate_type, at cp/class.c:6163

Here are the full details of the gcc -v output, the command line used for
compilation, and the resulting output (including the above error msg):

Script started on Sun Apr 24 13:35:42 2011
% /usr/local/bin/eg++ -v
Using built-in specs.
Target: i386-unknown-openbsd4.8
Configured with: /usr/obj/i386/gcc-4.2.4/gcc-4.2.4/configure
--with-gmp=/usr/local --enable-libgcj --verbose --progra
m-transform-name=s,^,e, --disable-nls --disable-checking --with-system-zlib
--disable-libmudflap --disable-libgomp --
disable-tls --with-as=/usr/bin/as --with-ld=/usr/bin/ld --with-gnu-ld
--with-gnu-as --enable-threads=posix --enable-w
char_t --enable-languages=c,c++,fortran,objc,java,ada --enable-cpp
--with-gnu-as --with-gnu-ld --enable-shared --pref
ix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man
--infodir=/usr/local/info
Thread model: posix
gcc version 4.2.4
% /usr/local/bin/eg++ -v -save-temps -c complex-conditional-real-imag-nofn.cc
Using built-in specs.
Target: i386-unknown-openbsd4.8
Configured with: /usr/obj/i386/gcc-4.2.4/gcc-4.2.4/configure
--with-gmp=/usr/local --enable-libgcj --verbose --progra
m-transform-name=s,^,e, --disable-nls --disable-checking --with-system-zlib
--disable-libmudflap --disable-libgomp --
disable-tls --with-as=/usr/bin/as --with-ld=/usr/bin/ld --with-gnu-ld
--with-gnu-as --enable-threads=posix --enable-w
char_t --enable-languages=c,c++,fortran,objc,java,ada --enable-cpp
--with-gnu-as --with-gnu-ld --enable-shared --pref
ix=/usr/local --sysconfdir=/etc --mandir=/usr/local/man
--infodir=/usr/local/info
Thread model: posix
gcc version 4.2.4
 /usr/local/libexec/gcc/i386-unknown-openbsd4.8/4.2.4/cc1plus -E -quiet -v
complex-conditional-real-imag-nofn.cc -mtu
ne=i386 -fpch-preprocess -o complex-conditional-real-imag-nofn.ii
ignoring nonexistent directory
"/usr/local/lib/gcc/i386-unknown-openbsd4.8/4.2.4/../../../../i386-unknown-openbsd4.8/
include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i386-unknown-openbsd4.8/4.2.4/../../../../include/c++/4.2.4

/usr/local/lib/gcc/i386-unknown-openbsd4.8/4.2.4/../../../../include/c++/4.2.4/i386-unknown-openbsd4.8

/usr/local/lib/gcc/i386-unknown-openbsd4.8/4.2.4/../../../../include/c++/4.2.4/backward
 /usr/local/include
 /usr/local/lib/gcc/i386-unknown-openbsd4.8/4.2.4/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i386-unknown-openbsd4.8/4.2.4/cc1plus -fpreprocessed
complex-conditional-real-imag-nofn.ii -q
uiet -dumpbase complex-conditional-real-imag-nofn.cc -mtune=i386 -auxbase
complex-conditional-real-imag-nofn -version
 -o complex-conditional-real-imag-nofn.s
GNU C++ version 4.2.4 (i386-unknown-openbsd4.8)
        compiled by GNU C version 4.2.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 6dfb71ffb2dea5673cd2557319059568
complex-conditional-real-imag-nofn.cc: In function 'double
foo(std::complex<double>, bool)':
complex-conditional-real-imag-nofn.cc:5: internal compiler error: in
instantiate_type, at cp/class.c:6163
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
% exit

Script done on Sun Apr 24 13:36:04 2011

Reply via email to