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

            Bug ID: 92352
           Summary: ICE in force_constant_size
           Product: gcc
           Version: 9.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ gcc-9.2.0 -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/9.2.0/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/9.2.0/install/libexec/gcc/x86_64-pc-linux-gnu/9.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9.2.0/configure
--prefix=/home/tom/Documents/gcc/9.2.0/install --enable-languages=c,c++
--disable-multilib
Thread model: posix
gcc version 9.2.0 (GCC) 

$ cat test.c 

void foo ( long int arg ) 
{ 
    int var[arg] ; 
    asm volatile ( "" : "+r" ( var ) ) ; 
}


$ gcc-9.2.0 test.c 
test.c: In function ‘foo’:
test.c:5:5: internal compiler error: in force_constant_size, at gimplify.c:712
    5 |     asm volatile ( "" : "+r" ( var ) ) ;
      |     ^~~
0x5b67a9 force_constant_size
        ../../gcc-9.2.0/gcc/gimplify.c:712
0x8625af gimple_add_tmp_var(tree_node*)
        ../../gcc-9.2.0/gcc/gimplify.c:750
0x83d016 create_tmp_var(tree_node*, char const*)
        ../../gcc-9.2.0/gcc/gimple-expr.c:482
0x86b09f create_tmp_from_val
        ../../gcc-9.2.0/gcc/gimplify.c:541
0x86b09f lookup_tmp_var
        ../../gcc-9.2.0/gcc/gimplify.c:562
0x86b09f internal_get_tmp_var
        ../../gcc-9.2.0/gcc/gimplify.c:615
0x86602d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9.2.0/gcc/gimplify.c:13464
0x86d1b7 gimplify_asm_expr
        ../../gcc-9.2.0/gcc/gimplify.c:6386
0x867860 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9.2.0/gcc/gimplify.c:12834
0x8694e6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9.2.0/gcc/gimplify.c:6718
0x867763 gimplify_statement_list
        ../../gcc-9.2.0/gcc/gimplify.c:1794
0x867763 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9.2.0/gcc/gimplify.c:12931
0x8694e6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9.2.0/gcc/gimplify.c:6718
0x869ddf gimplify_bind_expr
        ../../gcc-9.2.0/gcc/gimplify.c:1362
0x866d59 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9.2.0/gcc/gimplify.c:12703
0x8694e6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9.2.0/gcc/gimplify.c:6718
0x86a7c6 gimplify_body(tree_node*, bool)
        ../../gcc-9.2.0/gcc/gimplify.c:13711
0x86aa75 gimplify_function_tree(tree_node*)
        ../../gcc-9.2.0/gcc/gimplify.c:13855
0x71f18f cgraph_node::analyze()
        ../../gcc-9.2.0/gcc/cgraphunit.c:667
0x7216e7 analyze_functions
        ../../gcc-9.2.0/gcc/cgraphunit.c:1126
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.



I tried the snapshot version gcc-9-20191102, the ICE is nearly same.



$ gcc-snapshot -v
Using built-in specs.
COLLECT_GCC=/home/tom/Documents/gcc/9-20191102/install/bin/gcc
COLLECT_LTO_WRAPPER=/home/tom/Documents/gcc/9-20191102/install/libexec/gcc/x86_64-pc-linux-gnu/9.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-9-20191102/configure
--prefix=/home/tom/Documents/gcc/9-20191102/install
Thread model: posix
gcc version 9.2.1 20191102 (GCC) 

$ gcc-snapshot test.c 
test.c: In function ‘foo’:
test.c:5:5: internal compiler error: in force_constant_size, at gimplify.c:712
    5 |     asm volatile ( "" : "+r" ( var ) ) ;
      |     ^~~
0x5b698d force_constant_size
        ../../gcc-9-20191102/gcc/gimplify.c:712
0x862c3f gimple_add_tmp_var(tree_node*)
        ../../gcc-9-20191102/gcc/gimplify.c:750
0x83d696 create_tmp_var(tree_node*, char const*)
        ../../gcc-9-20191102/gcc/gimple-expr.c:482
0x86b75f create_tmp_from_val
        ../../gcc-9-20191102/gcc/gimplify.c:541
0x86b75f lookup_tmp_var
        ../../gcc-9-20191102/gcc/gimplify.c:562
0x86b75f internal_get_tmp_var
        ../../gcc-9-20191102/gcc/gimplify.c:615
0x8666dd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9-20191102/gcc/gimplify.c:13466
0x86d877 gimplify_asm_expr
        ../../gcc-9-20191102/gcc/gimplify.c:6386
0x867f18 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9-20191102/gcc/gimplify.c:12836
0x869ba6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9-20191102/gcc/gimplify.c:6718
0x867e1b gimplify_statement_list
        ../../gcc-9-20191102/gcc/gimplify.c:1794
0x867e1b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9-20191102/gcc/gimplify.c:12933
0x869ba6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9-20191102/gcc/gimplify.c:6718
0x86a49f gimplify_bind_expr
        ../../gcc-9-20191102/gcc/gimplify.c:1362
0x867409 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-9-20191102/gcc/gimplify.c:12705
0x869ba6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-9-20191102/gcc/gimplify.c:6718
0x86ae86 gimplify_body(tree_node*, bool)
        ../../gcc-9-20191102/gcc/gimplify.c:13713
0x86b135 gimplify_function_tree(tree_node*)
        ../../gcc-9-20191102/gcc/gimplify.c:13857
0x71f88f cgraph_node::analyze()
        ../../gcc-9-20191102/gcc/cgraphunit.c:667
0x721de7 analyze_functions
        ../../gcc-9-20191102/gcc/cgraphunit.c:1126
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to