Bug 105977 - [12/13 Regression] ICE in gimple_call_static_chain_flags, at gimple.cc:1636
Summary: [12/13 Regression] ICE in gimple_call_static_chain_flags, at gimple.cc:1636
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: 12.2
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2022-06-14 17:47 UTC by G. Steinmetz
Modified: 2022-07-25 16:00 UTC (History)
2 users (show)

See Also:
Host:
Target: x86_64-pc-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-06-15 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description G. Steinmetz 2022-06-14 17:47:28 UTC
Started between 20211107 and 20211114, at -Os :
(from gcc.c-torture/execute/920612-2.c)
(gcc configured with --enable-checking=yes)


$ cat z1.c
void f ()
{
  int i = 0;
  int a (int x)
    {
      while (x)
        i++, x--;
      return x;
    }
  if (a (2) != 0)
    return;
}


$ gcc-13-20220612 -c z1.c -O2 -fdisable-ipa-inline
cc1: note: disable pass ipa-inline for functions in the range of [0, 4294967295]
$
$ gcc-13-20220612 -c z1.c -Os -fdisable-ipa-inline
cc1: note: disable pass ipa-inline for functions in the range of [0, 4294967295]
during GIMPLE pass: alias
z1.c: In function 'f':
z1.c:1:6: internal compiler error: in gimple_call_static_chain_flags, at gimple.cc:1636
    1 | void f ()
      |      ^
0xa75e29 gimple_call_static_chain_flags(gcall const*)
        ../../gcc/gimple.cc:1636
0x1086681 handle_rhs_call
        ../../gcc/tree-ssa-structalias.cc:4345
0x1087fe5 find_func_aliases_for_call
        ../../gcc/tree-ssa-structalias.cc:5010
0x1087fe5 find_func_aliases
        ../../gcc/tree-ssa-structalias.cc:5113
0x108b7a6 compute_points_to_sets
        ../../gcc/tree-ssa-structalias.cc:7536
0x108b7a6 compute_may_aliases()
        ../../gcc/tree-ssa-structalias.cc:8044
0xd0bbde execute_function_todo
        ../../gcc/passes.cc:2057
0xd0c712 execute_todo
        ../../gcc/passes.cc:2139
Comment 1 Richard Biener 2022-06-15 09:12:17 UTC
-fdisable-ipa-inline might confuse us enough here, we run into

1634          /* Nested functions should always bind to current def since
1635             there is no public ABI for them.  */
1636          gcc_checking_assert (node->binds_to_current_def_p ());
(gdb) p node->debug()
a.0/0 (a) @0x7ffff6a26000
  Type: function
  Body removed by symtab_remove_unreachable_nodes
  Visibility: semantic_interposition prevailing_def_ironly
  References: 
  Referring: 
  Availability: not_available
  Function flags: count:118111600 (estimated locally) optimize_size static_chain
  Called by: 
  Calls: 
$3 = void

might be not a bug, -fdisable-* are only for debugging.
Comment 2 hubicka 2022-06-15 10:08:42 UTC
Inline transform function does fixup_cfg and other mandatory things so
disabling it will likely cause other kind of ICEs as well.  I wonder if
there is more robust way to do so (one can make these part of
all_ipa_tranforms and not part of a pass but it looks bit ugly).
Comment 3 Richard Biener 2022-07-25 16:00:55 UTC
Let's close it as invalid.