[Bug c++/82084] New: internal compiler error: constructing wstring with -O3

no_spam@loehndorf-flintbek.de gcc-bugzilla@gcc.gnu.org
Sat Sep 2 12:18:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82084

            Bug ID: 82084
           Summary: internal compiler error: constructing wstring with -O3
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: no_spam@loehndorf-flintbek.de
  Target Milestone: ---

Created attachment 42107
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42107&action=edit
preprocessed file for gcc 7

#include <string>
int main()
{
    wchar_t strs[4][2]= {  L"A", L"B", L"C" , L"D"};
    std::wstring ss(strs[0]);
    return 0;
}


Commandline:
gcc -O3 -c test.cpp -o test.o



Error message:
test.cpp: In function ‘int main()’:
test.cpp:2:5: internal compiler error: in vect_get_constant_vectors, at
tree-vect-slp.c:3221
 int main()
     ^~~~
0xcc009a vect_get_constant_vectors
        ../../src/gcc/tree-vect-slp.c:3221
0xcc084a vect_get_slp_defs(vec<tree_node*, va_heap, vl_ptr>, _slp_tree*,
vec<vec<tree_node*, va_heap, vl_ptr>, va_heap, vl_ptr>*, int)
        ../../src/gcc/tree-vect-slp.c:3453
0xc93060 vect_get_vec_defs(tree_node*, tree_node*, gimple*, vec<tree_node*,
va_heap, vl_ptr>*, vec<tree_node*, va_heap, vl_ptr>*, _slp_tree*, int)
        ../../src/gcc/tree-vect-stmts.c:1558
0xc9bc16 vectorizable_store
        ../../src/gcc/tree-vect-stmts.c:6201
0xca68d6 vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
        ../../src/gcc/tree-vect-stmts.c:8696
0xcbdeca vect_schedule_slp_instance
        ../../src/gcc/tree-vect-slp.c:3787
0xcbf715 vect_schedule_slp(vec_info*)
        ../../src/gcc/tree-vect-slp.c:3858
0xcc4d47 vect_slp_bb(basic_block_def*)
        ../../src/gcc/tree-vect-slp.c:2891
0xcc5fb5 execute
        ../../src/gcc/tree-vectorizer.c:908

gcc version: gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.2.0-1'
--with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr
--with-gcc-major-version-only --program-suffix=-7
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --with-target-system-zlib --enable-objc-gc=auto
--enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-offload-targets=nvptx-none --without-cuda-driver
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Debian 7.2.0-1) 


Compiles fine without optimization or -O2, also fails in with gcc-6

Using built-in specs.
COLLECT_GCC=gcc-6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 6.4.0-3'
--with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-6 --program-prefix=x86_64-linux-gnu- --enable-shared
--enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie
--with-system-zlib --disable-browser-plugin --enable-java-awt=gtk
--enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--with-target-system-zlib --enable-objc-gc=auto --enable-multiarch
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.4.0 20170805 (Debian 6.4.0-3)


More information about the Gcc-bugs mailing list