https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83514
Bug ID: 83514 Summary: ABRT in arm_declare_function_name passing a null pointer to std::string Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- I stumbled into this while debugging the ARM cross-compiler. Looks like back-end assumes targ_options->x_arm_arch_string is non-null, even though when invoked with just the options below it can be null. (gdb) r -O2 -Wall -isystem /ssd/build/arm-linux-gnueabi/gcc-git/gcc/include -quiet /build/tmp/a.c Starting program: /ssd/build/arm-linux-gnueabi/gcc-git/gcc/cc1 -O2 -Wall -isystem /ssd/build/arm-linux-gnueabi/gcc-git/gcc/include -quiet /build/tmp/a.c Program received signal SIGABRT, Aborted. 0x00007ffff688c91f in raise () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff688c91f in raise () from /lib64/libc.so.6 #1 0x00007ffff688e51a in abort () from /lib64/libc.so.6 #2 0x00007ffff71ce52d in __gnu_cxx::__verbose_terminate_handler() () from /lib64/libstdc++.so.6 #3 0x00007ffff71cc2d6 in ?? () from /lib64/libstdc++.so.6 #4 0x00007ffff71cc321 in std::terminate() () from /lib64/libstdc++.so.6 #5 0x00007ffff71cc539 in __cxa_throw () from /lib64/libstdc++.so.6 #6 0x00007ffff71f5f0f in std::__throw_logic_error(char const*) () from /lib64/libstdc++.so.6 #7 0x00007ffff7263614 in void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>(char const*, char const*, std::forward_iterator_tag) () from /lib64/libstdc++.so.6 #8 0x00007ffff72637cc in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&) () from /lib64/libstdc++.so.6 #9 0x000000000157c8ab in arm_declare_function_name (stream=0x2a28140, name=0x7fffefac5f68 "f", decl=0x7fffef94dd00) at /ssd/src/gcc/git/gcc/config/arm/arm.c:30984 ... (gdb) frame 9 #9 0x000000000157c8ab in arm_declare_function_name (stream=0x2a28140, name=0x7fffefac5f68 "f", decl=0x7fffef94dd00) at /ssd/src/gcc/git/gcc/config/arm/arm.c:30984 30984 std::string arch_to_print = targ_options->x_arm_arch_string; (gdb) p targ_options->x_arm_arch_string $5 = 0x0