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

            Bug ID: 123324
           Summary: ICE: in force_constant_size, at gimplify.cc
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: 522024330006 at smail dot nju.edu.cn
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/7debov1h1

```c
#include <stdarg.h>
#include <stdio.h>

void vf_caller(size_t cnt, ...) {
    va_list args;
    va_start(args, cnt);
    for (size_t i = 0; i < cnt; ++i) {
        int *a = va_arg(args, int[i]); // need a flexible size vector
    }
    va_end(args);
}
```
Go back to gcc 6.1.

Part of the traceback:
```
<source>: In function 'vf_caller':
<source>:8:31: internal compiler error: in force_constant_size, at
gimplify.cc:802
    8 |         int *a = va_arg(args, int[i]); // need a flexible size vector
      |                               ^~~
0x2ea6b35 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2ebdb06 internal_error(char const*, ...)
        ???:0
0xf5795e fancy_abort(char const*, int, char const*)
        ???:0
0x1369497 gimple_add_tmp_var(tree_node*)
        ???:0
0x131167b create_tmp_var(tree_node*, char const*)
        ???:0
0x1371f7b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13744b3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x1372892 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x13738ee gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x1373cca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x1373523 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x1373523 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x1373cca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0x13761ca gimplify_stmt(tree_node**, gimple**)
        ???:0
0x1373523 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???: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
```
  • [Bug middle-end/123324] ... 522024330006 at smail dot nju.edu.cn via Gcc-bugs

Reply via email to