public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gscfq@t-online.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/103415] [12 Regression] ICE in cpp_interpret_string_1, at libcpp/charset.c:1739
Date: Wed, 24 Nov 2021 17:49:01 +0000	[thread overview]
Message-ID: <bug-103415-4-m7d96EbNYU@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-103415-4@http.gcc.gnu.org/bugzilla/>

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

G. Steinmetz <gscfq@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code

--- Comment #1 from G. Steinmetz <gscfq@t-online.de> ---

Probably related :


$ cat z2.c
#define n(x...) #__VA_OPT__(x##__VA_ARGS__##c)
const char *c n(1)


$ cat z3.c
#define n(x...) = #__VA_OPT__(x##__VA_ARGS__##c)
const char *c n(1);


$ gcc-12-20211121 -c z2.c
z2.c:1:18: warning: __VA_OPT__ can only appear in the expansion of a C++20
variadic macro
    1 | #define n(x...) #__VA_OPT__(x##__VA_ARGS__##c)
      |                  ^
z2.c:1:32: warning: __VA_ARGS__ can only appear in the expansion of a C99
variadic macro
    1 | #define n(x...) #__VA_OPT__(x##__VA_ARGS__##c)
      |                                ^
z2.c:2:1: internal compiler error: Segmentation fault
    2 | const char *c n(1)
      | ^~~~~
0xcb463f crash_signal
        ../../gcc/toplev.c:322
0x18d0cca new_string_token
        ../../libcpp/macro.c:472
0x18d0cca stringify_arg
        ../../libcpp/macro.c:941
0x18d32e3 replace_args
        ../../libcpp/macro.c:2068
0x18d32e3 enter_macro_context
        ../../libcpp/macro.c:1496
0x18d3750 cpp_get_token_1
        ../../libcpp/macro.c:2986
0x7ff27d c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
        ../../gcc/c-family/c-lex.c:483
0x78743f c_lex_one_token
        ../../gcc/c/c-parser.c:279
0x788414 c_parser_peek_nth_token(c_parser*, unsigned int)
        ../../gcc/c/c-parser.c:517
0x7889a0 c_parser_nth_token_starts_std_attributes
        ../../gcc/c/c-parser.c:5092
0x79524b c_parser_direct_declarator
        ../../gcc/c/c-parser.c:3951
0x79524b c_parser_declarator(c_parser*, bool, c_dtr_syn, bool*)
        ../../gcc/c/c-parser.c:3894
0x795033 c_parser_declarator(c_parser*, bool, c_dtr_syn, bool*)
        ../../gcc/c/c-parser.c:3886
0x7ae573 c_parser_declaration_or_fndef
        ../../gcc/c/c-parser.c:2154
0x7b70cf c_parser_external_declaration
        ../../gcc/c/c-parser.c:1780
0x7b79fb c_parser_translation_unit
        ../../gcc/c/c-parser.c:1653
0x7b79fb c_parse_file()
        ../../gcc/c/c-parser.c:23280
0x808eb2 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1240

  reply	other threads:[~2021-11-24 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-24 17:48 [Bug c/103415] New: " gscfq@t-online.de
2021-11-24 17:49 ` gscfq@t-online.de [this message]
2021-11-24 17:51 ` [Bug preprocessor/103415] " pinskia at gcc dot gnu.org
2021-11-25  0:33 ` pinskia at gcc dot gnu.org
2021-11-25  9:58 ` marxin at gcc dot gnu.org
2021-11-25 15:25 ` jakub at gcc dot gnu.org
2021-11-25 17:11 ` jakub at gcc dot gnu.org
2021-12-01  9:10 ` cvs-commit at gcc dot gnu.org
2021-12-01  9:16 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-103415-4-m7d96EbNYU@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).