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

            Bug ID: 57863
           Summary: std::vector<>::emplace_back() internal compiler error
                    when passing wrong number of arguments
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: maxim.yegorushkin at gmail dot com

Passing wrong number of arguments into std::vector<>::emplace_back() causes an
internal compiler error:

    #include <vector>

    struct Xyz
    {
        Xyz(int, int);
    };

    int main() {
        std::vector<Xyz> v;
        v.emplace_back(1); // internal compiler error here
    }

This is how I compile it:

/usr/local/ots/2/bin/g++ -v -c -o
/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.o 
-pthread   -m64 -I/home/max/otsquant/src/c++ -D_GLIBCXX_USE_C99_MATH
-D__STDC_FORMAT_MACROS -D_GLIBCXX_USE_CLOCK_MONOTONIC
-DBOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS -I/usr/local/ots/2/icu-50.1/include
-I/usr/local/ots/2/boost-1.53.0/include -I/usr/local/ots/2/include/python2.7 
-g -Wall -Wextra -Wno-missing-field-initializers -Winit-self -Wcast-align
-Wmissing-include-dirs -Wpointer-arith -Wwrite-strings -Wno-non-virtual-dtor
-Wno-multichar -march=native -fdiagnostics-show-option -Werror=return-type
-Werror=format -Werror=format-extra-args -Werror=reorder -Werror=uninitialized
-std=gnu++11 -Werror=narrowing -fmessage-length=0 -falign-functions   -MD -MP
-MF /home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.d
/home/max/otsquant/src/c++/test-c++/test.cc
Using built-in specs.
COLLECT_GCC=/usr/local/ots/2/bin/g++47
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.7.3-src/configure --prefix=/usr/local/ots/2
--program-suffix=47 --disable-libunwind-exceptions --with-system-zlib
--enable-__cxa_atexit --enable-checking=release --disable-multilib
--with-gmp-include=/usr/local/ots/2/include
--with-mpfr-include=/usr/local/ots/2/include
--with-mpc-include=/usr/local/ots/2/include
--with-ppl-include=/usr/local/ots/2/include
--with-cloog-include=/usr/local/ots/2/include
--with-binutils-include=/usr/local/ots/2/include
--with-gmp-lib=/usr/local/ots/2/lib64 --with-mpfr-lib=/usr/local/ots/2/lib64
--with-mpc-lib=/usr/local/ots/2/lib64 --with-ppl-lib=/usr/local/ots/2/lib64
--with-cloog-lib=/usr/local/ots/2/lib64
--with-binutils-lib=/usr/local/ots/2/lib64 --enable-languages=c,c++,fortran,lto
--enable-plugin --enable-initfini-array --enable-gold=default
Thread model: posix
gcc version 4.7.3 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-c' '-o'
'/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.o'
'-pthread' '-m64' '-I' '/home/max/otsquant/src/c++' '-D'
'_GLIBCXX_USE_C99_MATH' '-D' '__STDC_FORMAT_MACROS' '-D'
'_GLIBCXX_USE_CLOCK_MONOTONIC' '-D' 'BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS'
'-I' '/usr/local/ots/2/icu-50.1/include' '-I'
'/usr/local/ots/2/boost-1.53.0/include' '-I'
'/usr/local/ots/2/include/python2.7' '-g' '-Wall' '-Wextra'
'-Wno-missing-field-initializers' '-Winit-self' '-Wcast-align'
'-Wmissing-include-dirs' '-Wpointer-arith' '-Wwrite-strings'
'-Wno-non-virtual-dtor' '-Wno-multichar' '-march=native'
'-fdiagnostics-show-option' '-Werror=return-type' '-Werror=format'
'-Werror=format-extra-args' '-Werror=reorder' '-Werror=uninitialized'
'-std=gnu++11' '-Werror=narrowing' '-fmessage-length=0' '-falign-functions'
'-MD' '-MP' '-MF'
'/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.d'
'-shared-libgcc'
 /usr/local/ots/2/libexec/gcc/x86_64-unknown-linux-gnu/4.7.3/cc1plus -quiet -v
-I /home/max/otsquant/src/c++ -I /usr/local/ots/2/icu-50.1/include -I
/usr/local/ots/2/boost-1.53.0/include -I /usr/local/ots/2/include/python2.7 -MD
/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.d -MF
/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.d -MP
-MQ /home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.o
-D_GNU_SOURCE -D_REENTRANT -D _GLIBCXX_USE_C99_MATH -D __STDC_FORMAT_MACROS -D
_GLIBCXX_USE_CLOCK_MONOTONIC -D BOOST_THREAD_DONT_PROVIDE_INTERRUPTIONS
/home/max/otsquant/src/c++/test-c++/test.cc -march=corei7 -mcx16 -msahf
-mno-movbe -mno-aes -mno-pclmul -mpopcnt -mno-abm -mno-lwp -mno-fma -mno-fma4
-mno-xop -mno-bmi -mno-bmi2 -mno-tbm -mno-avx -mno-avx2 -msse4.2 -msse4.1
-mno-lzcnt -mno-rdrnd -mno-f16c -mno-fsgsbase --param l1-cache-size=32 --param
l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=corei7 -quiet -dumpbase
test.cc -m64 -auxbase-strip
/home/max/otsquant/build/Linux-x86_64-64.g++-debug/obj-mt/test-c++/test.o -g
-Wall -Wextra -Wno-missing-field-initializers -Winit-self -Wcast-align
-Wmissing-include-dirs -Wpointer-arith -Wwrite-strings -Wno-non-virtual-dtor
-Wno-multichar -Werror=return-type -Werror=format -Werror=format-extra-args
-Werror=reorder -Werror=uninitialized -Werror=narrowing -std=gnu++11 -version
-fdiagnostics-show-option -fmessage-length=0 -falign-functions -o
/tmp/ccy3bMvU.s
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.3, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/max/otsquant/src/c++
 /usr/local/ots/2/icu-50.1/include
 /usr/local/ots/2/boost-1.53.0/include
 /usr/local/ots/2/include/python2.7

/usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3

/usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/x86_64-unknown-linux-gnu

/usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/../../../../include/c++/4.7.3/backward
 /usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include
 /usr/local/include
 /usr/local/ots/2/include
 /usr/local/ots/2/lib/gcc/x86_64-unknown-linux-gnu/4.7.3/include-fixed
 /usr/include
End of search list.
GNU C++ (GCC) version 4.7.3 (x86_64-unknown-linux-gnu)
    compiled by GNU C version 4.7.3, GMP version 4.3.2, MPFR version 2.4.2, MPC
version 0.8.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: e1ce51b658ceeb99bd5527c5ac22d4e7
‘
Internal compiler error: Error reporting routines re-entered.
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Reply via email to