Bug 106207 - [11/12/13/14/15 Regression] ICE in apply_fixit, at edit-context.cc:769
Summary: [11/12/13/14/15 Regression] ICE in apply_fixit, at edit-context.cc:769
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 13.0
: P2 normal
Target Milestone: 11.5
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2022-07-05 18:47 UTC by G. Steinmetz
Modified: 2024-04-26 10:46 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-07-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2022-07-05 18:47:28 UTC
Started with r11 between 20201018 and 20201108,
and file gcc.dg/tree-ssa/pr77644.c :


$ g++-13-20220703 -c pr77644.c -ftrack-macro-expansion=0 -fdiagnostics-generate-patch
pr77644.c: In function 'int f_f1(float, float)':
pr77644.c:22:1: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   22 | GEN_FOO(float, f)
      | ^~~~~~~
pr77644.c:22:1: note: remove parentheses to default-initialize a variable
   22 | GEN_FOO(float, f)
      | ^~~~~~~
      | -------
pr77644.c:22:1: note: or replace parentheses with braces to value-initialize a variable
pr77644.c: In function 'int f_f2(float, float)':
pr77644.c:22:1: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
pr77644.c:22:1: note: remove parentheses to default-initialize a variable
   22 | GEN_FOO(float, f)
      | ^~~~~~~
      | -------

pr77644.c:22:1: internal compiler error: in apply_fixit, at edit-context.cc:769
0x1b6c4f0 edited_line::apply_fixit(int, int, char const*, int)
        ../../gcc/edit-context.cc:769
0x1b6d306 edit_context::add_fixits(rich_location*)
        ../../gcc/edit-context.cc:232
0x1b60344 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc/diagnostic.cc:1580
0x1b6069a diagnostic_impl
        ../../gcc/diagnostic.cc:1712
0x1b61f89 inform(rich_location*, char const*, ...)
        ../../gcc/diagnostic.cc:1804
0x7ddf27 warn_about_ambiguous_parse
        ../../gcc/cp/parser.cc:22338
0x81e50a cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22618
0x7fbb82 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:15336
0x7fd429 cp_parser_declaration_statement
        ../../gcc/cp/parser.cc:14417
0x7fda0b cp_parser_statement
        ../../gcc/cp/parser.cc:12494
0x7fe9d4 cp_parser_statement_seq_opt
        ../../gcc/cp/parser.cc:12906
0x7fea8f cp_parser_compound_statement
        ../../gcc/cp/parser.cc:12858
0x81d5e8 cp_parser_function_body
        ../../gcc/cp/parser.cc:25205
0x81d5e8 cp_parser_ctor_initializer_opt_and_function_body
        ../../gcc/cp/parser.cc:25256
0x81daa6 cp_parser_function_definition_after_declarator
        ../../gcc/cp/parser.cc:31404
0x81ec29 cp_parser_function_definition_from_specifiers_and_declarator
        ../../gcc/cp/parser.cc:31321
0x81ec29 cp_parser_init_declarator
        ../../gcc/cp/parser.cc:22658
0x7fbb82 cp_parser_simple_declaration
        ../../gcc/cp/parser.cc:15336
0x824958 cp_parser_declaration
        ../../gcc/cp/parser.cc:15022
0x825232 cp_parser_translation_unit
        ../../gcc/cp/parser.cc:5018
Comment 1 Marek Polacek 2022-07-05 18:59:14 UTC
Started with my r11-4756-g5b2003105b35f8.  Probably a latent issue though.
Comment 2 Marek Polacek 2022-08-09 19:59:41 UTC
Reduced:

#define FOO(no)  \
void f_##no() \
{ \
  int gen_##no(); \
}

#define GEN_FOO \
FOO(f##1) \
FOO(f##2)

GEN_FOO
Comment 3 Jakub Jelinek 2023-05-29 10:07:17 UTC
GCC 11.4 is being released, retargeting bugs to GCC 11.5.