https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84284
Bug ID: 84284 Summary: ICE compiling printf("\n"); with -fexec-charset=UTF-16 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: helge.hafting at ntnu dot no Target Milestone: --- Created attachment 43370 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43370&action=edit bug.cpp and bug.ii, the minimal file causing the ICE. (.cpp and .ii are identical) I am not sure that the testcase should compile with that flag, but even an error message ought to be better than 'internal compiler error'. I use either of these command lines: gcc -fexec-charset=UTF-16 bug.cpp g++ -fexec-charset=UTF-16 bug.cpp to compile this bug.cpp: extern "C" int printf(const char *, ...); void ice() { printf("\n"); } And get: bug.cpp: In function ‘void ice()’: bug.cpp:3:15: internal compiler error: character 0xa is not unibyte in execution character set printf("\n"); ~~~~~~^~~~~~ Please submit a full bug report, bug.cpp and bug.ii is attached. Other information you request: gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp Thread model: posix gcc version 7.2.1 20180116 (GCC) g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp Thread model: posix gcc version 7.2.1 20180116 (GCC)