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

            Bug ID: 84739
           Summary: [6/7/8 Regression] ICE in get_value_for_expr, at
                    tree-ssa-ccp.c:649
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions 6/7/8 at -O[s23] :


$ cat z1.c
static void baz (void) __attribute__((weakref("bar")));
int
foo (int x, int y)
{
  if (x)
    y = 0;
  if (y)
    goto L1;
  y = 0;
L1:
  return y;
}
void
bar (int x, int y)
{
  y = foo (x, y);
  if (y != 0)
    baz ();
}


$ gcc-5 -O2 -c z1.c
$
$ gcc-8-20180304 -O2 -c z1.c
z1.c:1:13: warning: 'baz' alias between functions of incompatible types
'void(void)' and 'void(int,  int)' [-Wattribute-alias]
 static void baz (void) __attribute__((weakref("bar")));
             ^~~
z1.c:14:1: note: aliased declaration here
 bar (int x, int y)
 ^~~
during GIMPLE pass: ccp
z1.c: In function 'bar':
z1.c:14:1: internal compiler error: Segmentation fault
0xaed10f crash_signal
        ../../gcc/toplev.c:325
0xbc5401 get_value_for_expr
        ../../gcc/tree-ssa-ccp.c:649
0xbc7ea8 ccp_propagate::visit_phi(gphi*)
        ../../gcc/tree-ssa-ccp.c:1133
0xc42778 ssa_propagation_engine::simulate_stmt(gimple*)
        ../../gcc/tree-ssa-propagate.c:233
0xc42992 ssa_propagation_engine::simulate_block(basic_block_def*)
        ../../gcc/tree-ssa-propagate.c:359
0xc43669 ssa_propagation_engine::ssa_propagate()
        ../../gcc/tree-ssa-propagate.c:800
0xbc4697 do_ssa_ccp
        ../../gcc/tree-ssa-ccp.c:2474
0xbc4697 execute
        ../../gcc/tree-ssa-ccp.c:2518

Reply via email to