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

            Bug ID: 119073
           Summary: [14/15 Regression] ICE in cp_gimplify_expr, at
                    cp/cp-gimplify.cc:911 with temporary vector in
                    range-for
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: philipp at fent dot de
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/fYjYreWaa

The following program generates an ICE on trunk, but compiles on 14.2:

#include <vector>
int main() {
   for (auto i : (true ? std::vector<int>{1, 2} : std::vector<int>{2, 1})) {
   }
}

Stack trace:

<source>: In function 'int main()':
<source>:4:31: internal compiler error: in cp_gimplify_expr, at
cp/cp-gimplify.cc:911
    4 |    for (auto i : (true ? std::vector<int>{1, 2} : std::vector<int>{2,
1})) {
      |                               ^~~~~~~~~~~~~~~~~
0x2917fc5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x292ef96 internal_error(char const*, ...)
        ???:0
0xacfd5e fancy_abort(char const*, int, char const*)
        ???:0
0x110920b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110b8f9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110b3b7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110b398 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x1109e52 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110b5e5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110acab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110b5fc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110b5fc gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x110d7da gimplify_stmt(tree_node**, gimple**)
        ???:0
0x110acab gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x1113b36 gimplify_body(tree_node*, bool)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

Reply via email to