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

            Bug ID: 98222
           Summary: ICE at -O3 on x86_64-pc-linux-gnu: verify_cgraph_node
                    failed
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

[517] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20201210 (experimental) [master revision
66dea8899df:e246cb295db:680e4202f23ce74f3b26c7f090b9d22a56765554] (GCC) 
[518] % 
[518] % gcctk -O2 small.c; ./a.out
[519] % 
[519] % gcctk -O3 small.c
small.c: In function ‘f’:
small.c:3:5: error: edge points to wrong declaration:
    3 | int f (int j, int k) {
      |     ^
 <function_decl 0x7f73b4ea3800 f.constprop.isra
    type <function_type 0x7f73b4e72d20
        type <void_type 0x7f73b4d56f18 void VOID
            align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f73b4d56f18
            pointer_to_this <pointer_type 0x7f73b4d5e000>>
        QI
        size <integer_cst 0x7f73b4d3ddc8 constant 8>
        unit-size <integer_cst 0x7f73b4d3dde0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f73b4e72d20
        arg-types <tree_list 0x7f73b4d528c0 value <void_type 0x7f73b4d56f18
void>>>
    addressable used nothrow static decl_5 QI small.c:3:5 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7f73b4d4ab40 small.c>>
 Instead of: <function_decl 0x7f73b4e74200 f
    type <function_type 0x7f73b4d6e348
        type <integer_type 0x7f73b4d565e8 int public SI
            size <integer_cst 0x7f73b4d3df18 constant 32>
            unit-size <integer_cst 0x7f73b4d3df30 constant 4>
            align:32 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x7f73b4d565e8 precision:32 min <integer_cst 0x7f73b4d3ded0 -2147483648> max
<integer_cst 0x7f73b4d3dee8 2147483647>
            pointer_to_this <pointer_type 0x7f73b4d5e9d8>>
        QI
        size <integer_cst 0x7f73b4d3ddc8 constant 8>
        unit-size <integer_cst 0x7f73b4d3dde0 constant 1>
        align:8 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f73b4d6e348
        arg-types <tree_list 0x7f73b4d6d2a8 value <integer_type 0x7f73b4d565e8
int>
            chain <tree_list 0x7f73b4d6d280 value <integer_type 0x7f73b4d565e8
int>
                chain <tree_list 0x7f73b4d528c0 value <void_type 0x7f73b4d56f18
void>>>>
        pointer_to_this <pointer_type 0x7f73b4e72dc8>>
    addressable used nothrow public static decl_5 QI small.c:3:5 align:8
warn_if_not_align:0 context <translation_unit_decl 0x7f73b4d4ab40 small.c>
initial <block 0x7f73b4e77420>
    result <result_decl 0x7f73b4d4aa50 D.1948 type <integer_type 0x7f73b4d565e8
int>
        ignored SI small.c:3:5 size <integer_cst 0x7f73b4d3df18 32> unit-size
<integer_cst 0x7f73b4d3df30 4>
        align:32 warn_if_not_align:0 context <function_decl 0x7f73b4e74200 f>>
    arguments <parm_decl 0x7f73b4e97180 j type <integer_type 0x7f73b4d565e8
int>
        used read SI small.c:3:12 size <integer_cst 0x7f73b4d3df18 32>
unit-size <integer_cst 0x7f73b4d3df30 4>
        align:32 warn_if_not_align:0 context <function_decl 0x7f73b4e74200 f>
arg-type <integer_type 0x7f73b4d565e8 int>
        chain <parm_decl 0x7f73b4e97200 k type <integer_type 0x7f73b4d565e8
int>
            used read SI small.c:3:19 size <integer_cst 0x7f73b4d3df18 32>
unit-size <integer_cst 0x7f73b4d3df30 4>
            align:32 warn_if_not_align:0 context <function_decl 0x7f73b4e74200
f> arg-type <integer_type 0x7f73b4d565e8 int>>>
    struct-function 0x7f73b4e99000 chain <function_decl 0x7f73b4e74400 main>>
f/42 (f) @0x7f73b4eb0440
  Type: function definition analyzed
  Visibility: artificial
  next sharing asm name: 41
  previous sharing asm name: 44
  References: b/1 (write) a/0 (read) b/1 (read) a/0 (read) c/2 (read) 
  Referring: 
  Function f/42 is inline copy in f/3
  Availability: local
  Function flags: count:462210652 (estimated locally) body local nonfreeing_fn
  Called by: f/41 (inlined) (462210652 (estimated locally),0.43 per call) 
  Calls: f/3 (415989587 (estimated locally),0.39 per call)
f.constprop.0.isra.0/6 (152529514 (estimated locally),0.14 per call) 
during IPA pass: inline
small.c:3:5: internal compiler error: verify_cgraph_node failed
0x83d218 cgraph_node::verify_node()
        ../../gcc-trunk/gcc/cgraph.c:3809
0x82956c symtab_node::verify()
        ../../gcc-trunk/gcc/symtab.c:1356
0xab2017 save_inline_function_body
        ../../gcc-trunk/gcc/ipa-inline-transform.c:679
0xab2017 inline_transform(cgraph_node*)
        ../../gcc-trunk/gcc/ipa-inline-transform.c:750
0xc29a49 execute_one_ipa_transform_pass
        ../../gcc-trunk/gcc/passes.c:2290
0xc29a49 execute_all_ipa_transforms(bool)
        ../../gcc-trunk/gcc/passes.c:2337
0x8422d5 cgraph_node::expand()
        ../../gcc-trunk/gcc/cgraphunit.c:1822
0x843c76 expand_all_functions
        ../../gcc-trunk/gcc/cgraphunit.c:1997
0x843c76 symbol_table::compile()
        ../../gcc-trunk/gcc/cgraphunit.c:2361
0x84721f symbol_table::compile()
        ../../gcc-trunk/gcc/cgraphunit.c:2545
0x84721f symbol_table::finalize_compilation_unit()
        ../../gcc-trunk/gcc/cgraphunit.c:2542
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.
[520] % 
[520] % cat small.c
int a, b, *c;

int f (int j, int k) {
  b = k / j;
  if (a)
    f(0, 0);
  *c = f(b & a, 0);
  return 0;
}

int main() {
  if (a)
    while (1)
      f(0, 0);
  return 0;
}

Reply via email to