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

            Bug ID: 122464
           Summary: internal compiler error: in force_constant_size, at
                    gimplify.cc:802
           Product: gcc
           Version: 15.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qingren2hxb at gmail dot com
  Target Milestone: ---

Created attachment 62654
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62654&action=edit
bug report by using -freport-bug

===============================
# gcc --version

gcc (GCC) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
===============================
int main() {
    int size = 42;

    typedef struct { char val[size]; } block;

    block b = {};

    block retframe_block() {
        return *(block *)&b;
    }

    void use_block(block x) {}

    use_block(retframe_block());
}
===============================
# gcc x.c

x.c: In function 'main':
x.c:15:15: internal compiler error: in force_constant_size, at gimplify.cc:802
   15 |     use_block(retframe_block());
      |               ^~~~~~~~~~~~~~
0x2157cc5 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2167ecf internal_error(char const*, ...)
        ???:0
0x7e9f61 fancy_abort(char const*, int, char const*)
        ???:0
0xb53447 gimple_add_tmp_var(tree_node*)
        ???:0
0xb00c6a create_tmp_var(tree_node*, char const*)
        ???:0
0xb5a867 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb5a22a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb611b9 gimplify_arg(tree_node**, gimple**, unsigned long, bool)
        ???:0
0xb597f8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb5a1d5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb59a27 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb5a1d5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ???:0
0xb5d995 gimplify_body(tree_node*, bool)
        ???:0
0xb5dda1 gimplify_function_tree(tree_node*)
        ???:0
0x9b854f cgraph_node::analyze()
        ???:0
0x9bb7ed symbol_table::finalize_compilation_unit()
        ???:0
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
  • [Bug c/122464] New: internal com... qingren2hxb at gmail dot com via Gcc-bugs

Reply via email to