https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101638
Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-08-04 Status|UNCONFIRMED |NEW CC| |jsm28 at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> --- Reduced test-case: $ cat y.c # define __GNUC_PREREQ(maj, min) 0 # define __glibc_has_attribute(attr) __has_attribute (attr) #if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__) #endif $ gcc y.c -Wtraditional -c y.c:1: internal compiler error: Segmentation fault 1 | # define __GNUC_PREREQ(maj, min) 0 | 0xeb7f3a crash_signal /home/marxin/Programming/gcc/gcc/toplev.c:328 0x7ffff786239f ??? ../sysdeps/unix/sysv/linux/sigaction.c:10 0x1b8a148 cpp_sys_macro_p(cpp_reader*) /home/marxin/Programming/gcc/libcpp/macro.c:3130 0x1b79158 cpp_classify_number(cpp_reader*, cpp_token const*, char const**, unsigned int) /home/marxin/Programming/gcc/libcpp/expr.c:786 0x1b7ae12 eval_token /home/marxin/Programming/gcc/libcpp/expr.c:1136 0x1b7ae12 _cpp_parse_expr /home/marxin/Programming/gcc/libcpp/expr.c:1354 0x1b73459 do_if /home/marxin/Programming/gcc/libcpp/directives.c:2055 0x1b75469 _cpp_handle_directive /home/marxin/Programming/gcc/libcpp/directives.c:553 0x1b846f0 _cpp_lex_token /home/marxin/Programming/gcc/libcpp/lex.c:2819 0x1b8c597 cpp_get_token_1 /home/marxin/Programming/gcc/libcpp/macro.c:2845 0x95627a c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int) /home/marxin/Programming/gcc/gcc/c-family/c-lex.c:483 0x8d2f8b c_lex_one_token /home/marxin/Programming/gcc/gcc/c/c-parser.c:279 0x8d3c91 c_parser_peek_token(c_parser*) /home/marxin/Programming/gcc/gcc/c/c-parser.c:483 0x9009cb c_parse_file() /home/marxin/Programming/gcc/gcc/c/c-parser.c:22115 0x964ce9 c_common_parse_file() /home/marxin/Programming/gcc/gcc/c-family/c-opts.c:1223 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Started with r11-4953-g1d00f8c86324c40a. ==421== Invalid read of size 1 ==421== at 0x1B8A148: cpp_sys_macro_p(cpp_reader*) (macro.c:3130) ==421== by 0x1B79158: cpp_classify_number(cpp_reader*, cpp_token const*, char const**, unsigned int) (expr.c:786) ==421== by 0x1B7AE12: eval_token (expr.c:1136) ==421== by 0x1B7AE12: _cpp_parse_expr (expr.c:1354) ==421== by 0x1B73459: do_if(cpp_reader*) (directives.c:2055) ==421== by 0x1B75469: _cpp_handle_directive (directives.c:553) ==421== by 0x1B846F0: _cpp_lex_token (lex.c:2819) ==421== by 0x1B8C597: cpp_get_token_1(cpp_reader*, unsigned int*) (macro.c:2845) ==421== by 0x95627A: c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int) (c-lex.c:483) ==421== by 0x8D2F8B: c_lex_one_token(c_parser*, c_token*, bool) (c-parser.c:279) ==421== by 0x8D3C91: c_parser_peek_token(c_parser*) (c-parser.c:483) ==421== by 0x9009CB: c_parse_file() (c-parser.c:22115) ==421== by 0x964CE9: c_common_parse_file() (c-opts.c:1223) ==421== Address 0x1e is not stack'd, malloc'd or (recently) free'd