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

            Bug ID: 96610
           Summary: [11 Regression] ICE: in gimplify_va_arg_expr, at
                    gimplify.c:15150
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: anbu1024.me at gmail dot com
  Target Milestone: ---

$ cat test.c 

void foo ( ) 
{
    int x ; 

    int y[] = 1; 

    __builtin_va_arg ( x, int z );
}

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

$ gcc-snapshot11 --version
gcc (GCC) 11.0.0 20200802 (experimental)
Copyright (C) 2020 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.

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

$ gcc-snapshot11 test.c 
test.c: In function ‘foo’:
test.c:6:15: error: invalid initializer
    6 |     int y[] = 1;
      |               ^
test.c:8:30: error: expected ‘)’ before ‘z’
    8 |     __builtin_va_arg ( x, int z );
      |                              ^~
      |                              )
test.c:8:27: error: first argument to ‘va_arg’ not of type ‘va_list’
    8 |     __builtin_va_arg ( x, int z );
      |                           ^~~
test.c:8:27: internal compiler error: in gimplify_va_arg_expr, at
gimplify.c:15150
    8 |     __builtin_va_arg ( x, int z );
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~
0x67c083 gimplify_va_arg_expr(tree_node**, gimple**, gimple**)
        ../../gcc-11-20200802/gcc/gimplify.c:15150
0xb12522 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-11-20200802/gcc/gimplify.c:13712
0xb15076 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-11-20200802/gcc/gimplify.c:6822
0xb130eb gimplify_statement_list
        ../../gcc-11-20200802/gcc/gimplify.c:1856
0xb130eb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-11-20200802/gcc/gimplify.c:14082
0xb15076 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-11-20200802/gcc/gimplify.c:6822
0xb15d41 gimplify_bind_expr
        ../../gcc-11-20200802/gcc/gimplify.c:1411
0xb1267d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
        ../../gcc-11-20200802/gcc/gimplify.c:13839
0xb2a797 gimplify_stmt(tree_node**, gimple**)
        ../../gcc-11-20200802/gcc/gimplify.c:6822
0xb2a797 gimplify_body(tree_node*, bool)
        ../../gcc-11-20200802/gcc/gimplify.c:14874
0xb2abcd gimplify_function_tree(tree_node*)
        ../../gcc-11-20200802/gcc/gimplify.c:15028
0x974437 cgraph_node::analyze()
        ../../gcc-11-20200802/gcc/cgraphunit.c:671
0x977477 analyze_functions
        ../../gcc-11-20200802/gcc/cgraphunit.c:1231
0x97803d symbol_table::finalize_compilation_unit()
        ../../gcc-11-20200802/gcc/cgraphunit.c:2987
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.

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

$ gcc-snapshot10 --version
gcc (GCC) 10.2.1 20200725
Copyright (C) 2020 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.

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

$ gcc-snapshot10 test.c 
test.c: In function ‘foo’:
test.c:6:15: error: invalid initializer
    6 |     int y[] = 1;
      |               ^
test.c:8:30: error: expected ‘)’ before ‘z’
    8 |     __builtin_va_arg ( x, int z );
      |                              ^~
      |                              )
test.c:8:27: error: first argument to ‘va_arg’ not of type ‘va_list’
    8 |     __builtin_va_arg ( x, int z );
      |                           ^~~
test.c:8: confused by earlier errors, bailing out

Reply via email to