This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/55753] New: [C++11][4.8 Regression] ICE constexpr ctor, tsubst_copy_and_build, at cp/pt.c:14336


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

             Bug #: 55753
           Summary: [C++11][4.8 Regression] ICE constexpr ctor,
                    tsubst_copy_and_build, at cp/pt.c:14336
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: david.abdurachmanov@gmail.com


Created attachment 29011
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29011
Testcase used.

Hi all,

Here is another C++11 regression in 4.8, I believe. Tested with GNU GCC 4.8.0
(r194629). Compiles fine if constexpr is removed from struct C ctor. Also
compiles fine on 4.7.2.

In addition tested with -Wall -Wextra and -fno-strict-aliasing -fwrapv, which
yielded the same results.

Originally noticed in code using std::complex, i.e., C could be replaced with
std::complex. E.g.,

std::complex<double> cpl = std::complex<double>((true ? 1.0 :
std::complex<double>()));

I am attaching *.ii test case.

Cheers,
david

### TESTCASE ###

template <typename Tp>
struct C {
  constexpr C(const Tp& r) { }
};

template <typename Tp>
struct B {
  B() {
    C<double> cpl = C<double>((true ? 1.0 : C<double>()));
  }
};

### COMPILATION LINE ###

g++ -m64 -O2 -std=c++11 -c testcase.cpp -fPIC -g -o ./testcase.o

### ICE ###

testcase.cpp: In constructor 'B<Tp>::B()':
testcase.cpp:9:55: internal compiler error: in tsubst_copy_and_build, at
cp/pt.c:14336
     C<double> cpl = C<double>((true ? 1.0 : C<double>()));
                                                       ^

### VERBOSE OUTPUT ###

Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-unknown-linux-gnu
Configured with: ../configure
--prefix=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-multilib --disable-nls --enable-languages=c,c++,fortran
--enable-gold=yes --enable-lto
--with-gmp=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpfr=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-mpc=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-isl=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--with-cloog=/build/davidlt/gcc480/b/tmp/BUILDROOT/b0fc97fddd2f40bb6a475bc4cb2eec22/opt/cmssw/slc5_amd64_gcc480/external/gcc/4.8.0
--disable-isl-version-check --enable-shared CC='gcc -fPIC' CXX='c++ -fPIC'
CPP=cpp CXXCPP='c++ -E'
Thread model: posix
gcc version 4.8.0 20121220 (experimental) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-O2' '-std=c++11' '-c' '-fPIC'
'-o' './testcase.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-E -quiet -v -iprefix
/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/
-D_GNU_SOURCE testcase.cpp -m64 -mtune=generic -march=x86-64 -std=c++11 -fPIC
-O2 -fpch-preprocess -o testcase.ii
ignoring nonexistent directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
ignoring duplicate directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0"
ignoring duplicate directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu"
ignoring duplicate directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward"
ignoring duplicate directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include"
ignoring duplicate directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed"
ignoring nonexistent directory
"/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/x86_64-unknown-linux-gnu

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../include/c++/4.8.0/backward

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.8.0/include-fixed
 /usr/local/include

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../lib/gcc/../../include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-O2' '-std=c++11' '-c' '-fPIC'
'-o' './testcase.o' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

/build/davidlt/gcc480/b/slc5_amd64_gcc480/external/gcc/4.8.0/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/cc1plus
-fpreprocessed testcase.ii -quiet -dumpbase testcase.cpp -m64 -mtune=generic
-march=x86-64 -auxbase-strip ./testcase.o -O2 -std=c++11 -version -fPIC -o
testcase.s
GNU C++ (GCC) version 4.8.0 20121220 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20121220 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU C++ (GCC) version 4.8.0 20121220 (experimental) (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.8.0 20121220 (experimental), GMP version 5.0.5,
MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: d2902122829bc83b42992b34ba9d5be6
testcase.cpp: In constructor 'B<Tp>::B()':
testcase.cpp:9:55: internal compiler error: in tsubst_copy_and_build, at
cp/pt.c:14336
     C<double> cpl = C<double>((true ? 1.0 : C<double>()));
                                                       ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]