public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58646] New: ICEs initializing VLAs
@ 2013-10-06 20:32 reichelt at gcc dot gnu.org
  2013-10-06 20:36 ` [Bug c++/58646] " reichelt at gcc dot gnu.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-06 20:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58646

            Bug ID: 58646
           Summary: ICEs initializing VLAs
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following related 4 code snippets trigger ICEs on trunk in different parts
of the compiler:

The first one crashes without any compiler options:

=========================
void foo(int n)
{
  int a[2][n] = {};
}
=========================

bug.cc: In function 'void foo(int)':
bug.cc:3:18: internal compiler error: in make_decl_rtl, at varasm.c:1214
   int a[2][n] = {};
                  ^
0xd24d63 make_decl_rtl(tree_node*)
        ../../gcc/gcc/varasm.c:1210
0x8a9409 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
        ../../gcc/gcc/expr.c:9320
0x8be7e7 expand_constructor
        ../../gcc/gcc/expr.c:7713
0x8a9244 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**)
        ../../gcc/gcc/expr.c:9557
0x8b3158 store_expr(tree_node*, rtx_def*, int, bool)
        ../../gcc/gcc/expr.c:5207
0x8b5569 expand_assignment(tree_node*, tree_node*, bool)
        ../../gcc/gcc/expr.c:4853
0x7df05d expand_gimple_stmt_1
        ../../gcc/gcc/cfgexpand.c:2274
0x7df05d expand_gimple_stmt
        ../../gcc/gcc/cfgexpand.c:2370
0x7e0ab3 expand_gimple_basic_block
        ../../gcc/gcc/cfgexpand.c:4209
0x7e23dc gimple_expand_cfg
        ../../gcc/gcc/cfgexpand.c:4728
0x7e23dc execute
        ../../gcc/gcc/cfgexpand.c:4942
Please submit a full bug report, [etc.]


The second one crashes if compiled with "-std=c++11":

=========================
void foo(int n)
{
  int a[n][2] = {};
}
=========================

bug.cc: In function 'void foo(int)':
bug.cc:3:18: internal compiler error: in gimplify_init_constructor, at
gimplify.c:4236
   int a[n][2] = {};
                  ^
0x96f293 gimplify_init_constructor
        ../../gcc/gcc/gimplify.c:4236
0x970a7e gimplify_modify_expr_rhs
        ../../gcc/gcc/gimplify.c:4518
0x970de4 gimplify_modify_expr
        ../../gcc/gcc/gimplify.c:4834
0x9661d5 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7332
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x9656fe gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5485
0x9656fe gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7669
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x9656fe gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5485
0x9656fe gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7669
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
Please submit a full bug report, [etc.]


The third one also crashes if compiled with "-std=c++11":

=========================
void foo(int n)
{
  int a[n][2][n] = {};
}
=========================

bug.cc: In function 'void foo(int)':
bug.cc:3:21: internal compiler error: in create_tmp_var, at gimplify.c:438
   int a[n][2][n] = {};
                     ^
0x962923 create_tmp_var(tree_node*, char const*)
        ../../gcc/gcc/gimplify.c:438
0x9641fc create_tmp_from_val
        ../../gcc/gcc/gimplify.c:521
0x9641fc lookup_tmp_var
        ../../gcc/gcc/gimplify.c:543
0x9641fc internal_get_tmp_var
        ../../gcc/gcc/gimplify.c:587
0x964bae gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:8163
0x96bb54 gimplify_compound_lval
        ../../gcc/gcc/gimplify.c:2257
0x965fa4 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7284
0x965010 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7728
0x970f58 gimplify_modify_expr
        ../../gcc/gcc/gimplify.c:4875
0x9661d5 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7332
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x9656fe gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5485
0x9656fe gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7669
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
Please submit a full bug report, [etc.]


The last one crashes if compiled with "-std=c++1y":

=========================
void foo(int n)
{
  int a[n][n] = {};
}
=========================

bug.cc: In function 'void foo(int)':
bug.cc:3:13: warning: array of array of runtime bound [-Wvla]
   int a[n][n] = {};
             ^
bug.cc:3:18: internal compiler error: in build2_stat, at tree.c:4104
   int a[n][n] = {};
                  ^
0xce51e0 build2_stat(tree_code, tree_node*, tree_node*, tree_node*)
        ../../gcc/gcc/tree.c:4103
0x9026bf build2_stat_loc
        ../../gcc/gcc/tree.h:3391
0x9026bf fold_build2_stat_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
        ../../gcc/gcc/fold-const.c:15053
0x96b573 gimplify_self_mod_expr(tree_node**, gimple_statement_d**,
gimple_statement_d**, bool, tree_node*)
        ../../gcc/gcc/gimplify.c:2375
0x965d6d gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7274
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x9656fe gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5485
0x9656fe gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7669
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x964f9b gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1525
0x964f9b gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7721
0x9691a6 gimplify_stmt(tree_node**, gimple_statement_d**)
        ../../gcc/gcc/gimplify.c:5709
0x969e7d gimplify_bind_expr
        ../../gcc/gcc/gimplify.c:1213
0x965f50 gimplify_expr(tree_node**, gimple_statement_d**, gimple_statement_d**,
bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7503
Please submit a full bug report, [etc.]


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-07-07  7:22 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-06 20:32 [Bug c++/58646] New: ICEs initializing VLAs reichelt at gcc dot gnu.org
2013-10-06 20:36 ` [Bug c++/58646] " reichelt at gcc dot gnu.org
2013-10-07 11:44 ` mpolacek at gcc dot gnu.org
2020-04-01  9:00 ` [Bug c++/58646] [8/9/10 Regression] ICE on a multidimensional VLA with an empty initializer list rguenth at gcc dot gnu.org
2021-05-14  9:46 ` [Bug c++/58646] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:06 ` rguenth at gcc dot gnu.org
2021-09-19 17:33 ` pinskia at gcc dot gnu.org
2021-10-01  7:16 ` pinskia at gcc dot gnu.org
2022-01-05 11:14 ` pinskia at gcc dot gnu.org
2022-01-21 17:48 ` pinskia at gcc dot gnu.org
2022-03-21 21:10 ` jason at gcc dot gnu.org
2022-03-21 22:25 ` cvs-commit at gcc dot gnu.org
2022-03-22  5:18 ` [Bug c++/58646] [9/10/11 " cvs-commit at gcc dot gnu.org
2022-05-27  9:34 ` [Bug c++/58646] [10/11 " rguenth at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-07-07  7:22 ` rguenth at gcc dot gnu.org

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).