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

            Bug ID: 87854
           Summary: [9 Regression] gcc.c-torture/compile/pr46534.c ICE for
                    16-bit size_t
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jozef.l at mittosystems dot com
  Target Milestone: ---

The constant string in this test is 2 * (10^7) long (a 25-bit number), on these
16-bit targets, size_t is an unsigned 16-bit int.

The test starts ICE'ing with r264292. The test successfully compiles for both
msp430 and avr with r264291.

> internal compiler error: in get_constant_size, at varasm.c:3310
> 17 |   printf (S7 "\n");
>    |
> 0xe7342c get_constant_size
>   ../../gcc/varasm.c:3309
> 0xe7b6e7 assemble_constant_contents
>   ../../gcc/varasm.c:3478
> 0xe84178 output_constant_def_contents
>   ../../gcc/varasm.c:3528
> 0xe80d28 maybe_output_constant_def_contents
>   ../../gcc/varasm.c:3466
> 0xe80d28 output_constant_def(tree_node*, int)
>   ../../gcc/varasm.c:3432
> 0x82027e expand_expr_constant
>   ../../gcc/expr.c:7821
> 0x82027e expand_expr_addr_expr_1
>   ../../gcc/expr.c:7848
> 0x81ffd0 expand_expr_addr_expr_1
>   ../../gcc/expr.c:7966
> 0x813f1a expand_expr_addr_expr
>   ../../gcc/expr.c:8042
> 0x813f1a expand_expr_real_1(tree_node*, rtx_def*, machine_mode, 
> expand_modifier, rtx_def**, bool)
>   ../../gcc/expr.c:11174
> 0x6da659 expand_normal
>   ../../gcc/expr.h:285
> 0x6da659 precompute_register_parameters
>   ../../gcc/calls.c:976
> 0x6da659 expand_call(tree_node*, rtx_def*, int)
>   ../../gcc/calls.c:3990
> 0x6c929d expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
>   ../../gcc/builtins.c:8136
> 0x814128 expand_expr_real_1(tree_node*, rtx_def*, machine_mode, 
> expand_modifier, rtx_def**, bool)
>   ../../gcc/expr.c:10943
> 0x6ef055 expand_expr
>   ../../gcc/expr.h:279
> 0x6ef055 expand_call_stmt
>   ../../gcc/cfgexpand.c:2694
> 0x6ef055 expand_gimple_stmt_1
>   ../../gcc/cfgexpand.c:3582
> 0x6ef683 expand_gimple_stmt
>   ../../gcc/cfgexpand.c:3741
> 0x6f07ab expand_gimple_basic_block
>   ../../gcc/cfgexpand.c:5777

The ICE then moves to expr.c with r264300

> internal compiler error: in string_constant, at expr.c:11415
> 0x811c13 string_constant(tree_node*, tree_node**, tree_node**, tree_node**)
>   ../../gcc/expr.c:11414
> 0x846d7b c_getstr(tree_node*, unsigned long*, unsigned long*)
>   ../../gcc/fold-const.c:14579
> 0x8b5da2 gimple_fold_builtin_printf
>   ../../gcc/gimple-fold.c:3366
> 0x8afd19 gimple_fold_builtin
>   ../../gcc/gimple-fold.c:3755
> 0x8b1c44 gimple_fold_call
>   ../../gcc/gimple-fold.c:4146
> 0x8b320a fold_stmt_1
>   ../../gcc/gimple-fold.c:4811
> 0x8eb5b0 gimplify_call_expr
>   ../../gcc/gimplify.c:3422
> 0x8d9518 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), 
> int)
>   ../../gcc/gimplify.c:11576
> 0x8ddc26 gimplify_stmt(tree_node**, gimple**)
>   ../../gcc/gimplify.c:6614
> 0x8df035 gimplify_bind_expr
>   ../../gcc/gimplify.c:1331
> 0x8d9181 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*), 
> int)
>   ../../gcc/gimplify.c:11805
> 0x8ddc26 gimplify_stmt(tree_node**, gimple**)
>   ../../gcc/gimplify.c:6614
> 0x8dfd96 gimplify_body(tree_node*, bool)
>   ../../gcc/gimplify.c:12799
> 0x8e0314 gimplify_function_tree(tree_node*)
>   ../../gcc/gimplify.c:12943
> 0x732497 cgraph_node::analyze()
>   ../../gcc/cgraphunit.c:669
> 0x73596a analyze_functions
>   ../../gcc/cgraphunit.c:1122
> 0x7367a2 symbol_table::finalize_compilation_unit()
>   ../../gcc/cgraphunit.c:2760

Rather than ICE'ing should there be some error message about object size being
too large?

Reply via email to