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

            Bug ID: 101858
           Summary: [12 Regression] ICE: ‘verify_gimple’ failed
           Product: gcc
           Version: 12.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 

int foo(a)
{
    if ( a < (int*)(1LL << a))
        a = 0;

    return a;
}

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

$ gcc-sp12 --version
gcc (GCC) 12.0.0 20210729 (experimental)
Copyright (C) 2021 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-sp12 test.c 
test.c: In function ‘foo’:
test.c:2:5: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
    2 | int foo(a)
      |     ^~~
test.c:4:12: warning: comparison between pointer and integer
    4 |     if ( a < (int*)(1LL << a))
      |            ^
test.c:2:5: error: type mismatch in ‘rshift_expr’
    2 | int foo(a)
      |     ^~~
int *
int *
int
_3 = _2 >> a;
test.c:2:5: internal compiler error: ‘verify_gimple’ failed
0xecbccd verify_gimple_in_seq(gimple*)
        ../../gcc-12-20210801/gcc/tree-cfg.c:5183
0xbe644a gimplify_body(tree_node*, bool)
        ../../gcc-12-20210801/gcc/gimplify.c:15539
0xbe657d gimplify_function_tree(tree_node*)
        ../../gcc-12-20210801/gcc/gimplify.c:15610
0xa1ed77 cgraph_node::analyze()
        ../../gcc-12-20210801/gcc/cgraphunit.c:670
0xa218f7 analyze_functions
        ../../gcc-12-20210801/gcc/cgraphunit.c:1234
0xa225bd symbol_table::finalize_compilation_unit()
        ../../gcc-12-20210801/gcc/cgraphunit.c:2508
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-sp11 --version
gcc (GCC) 11.1.1 20210717
Copyright (C) 2021 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-sp11 test.c 
test.c: In function ‘foo’:
test.c:2:5: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int]
    2 | int foo(a)
      |     ^~~
test.c:4:12: warning: comparison between pointer and integer
    4 |     if ( a < (int*)(1LL << a))
      |            ^
/usr/bin/ld: /lib/x86_64-linux-gnu/crt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status

Reply via email to