This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/71572] New: ICE on valid code on x86_64-linux-gnu: in force_constant_size, at gimplify.c:671


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

            Bug ID: 71572
           Summary: ICE on valid code on x86_64-linux-gnu: in
                    force_constant_size, at gimplify.c:671
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk on
x86_64-linux-gnu in both 32-bit and 64-bit modes.

It seems to affect all versions 4.7.x and later. 


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160617 (experimental) [trunk revision 237557] (GCC)
$
$ clang-3.8 -c small.c
$
$ gcc-trunk -c small.c
small.c: In function âfn1â:
small.c:7:3: internal compiler error: in force_constant_size, at gimplify.c:671
   __asm ("":"+g" (b));
   ^~~~~
0x946f46 force_constant_size
        ../../gcc-source-trunk/gcc/gimplify.c:671
0x94d897 gimple_add_tmp_var(tree_node*)
        ../../gcc-source-trunk/gcc/gimplify.c:709
0x92765a create_tmp_var(tree_node*, char const*)
        ../../gcc-source-trunk/gcc/gimple-expr.c:476
0x959194 create_tmp_from_val
        ../../gcc-source-trunk/gcc/gimplify.c:500
0x959194 lookup_tmp_var
        ../../gcc-source-trunk/gcc/gimplify.c:521
0x959194 internal_get_tmp_var
        ../../gcc-source-trunk/gcc/gimplify.c:574
0x9519c8 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-source-trunk/gcc/gimplify.c:11374
0x95fcfe gimplify_asm_expr
        ../../gcc-source-trunk/gcc/gimplify.c:5471
0x952ff5 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-source-trunk/gcc/gimplify.c:10754
0x9565a6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-source-trunk/gcc/gimplify.c:5767
0x95329b gimplify_statement_list
        ../../gcc-source-trunk/gcc/gimplify.c:1549
0x95329b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-source-trunk/gcc/gimplify.c:10851
0x9565a6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-source-trunk/gcc/gimplify.c:5767
0x9577c7 gimplify_bind_expr
        ../../gcc-source-trunk/gcc/gimplify.c:1154
0x9527f4 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-source-trunk/gcc/gimplify.c:10633
0x9565a6 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-source-trunk/gcc/gimplify.c:5767
0x9582cb gimplify_body(tree_node*, bool)
        ../../gcc-source-trunk/gcc/gimplify.c:11617
0x958926 gimplify_function_tree(tree_node*)
        ../../gcc-source-trunk/gcc/gimplify.c:11773
0x7d5667 cgraph_node::analyze()
        ../../gcc-source-trunk/gcc/cgraphunit.c:625
0x7d81f0 analyze_functions
        ../../gcc-source-trunk/gcc/cgraphunit.c:1086
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$


--------------------------


int a;

void
fn1 ()
{ 
  int b[a];
  __asm ("":"+g" (b));
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]