[Bug tree-optimization/82060] [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

2017-09-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

--- Comment #3 from Richard Biener  ---
Author: rguenth
Date: Mon Sep  4 10:57:20 2017
New Revision: 251650

URL: https://gcc.gnu.org/viewcvs?rev=251650=gcc=rev
Log:
2017-09-04  Richard Biener  

PR tree-optimization/82060
* tree-ssa-pre.c (eliminate_dom_walker::before_dom_children):
Move devirtualization after stmt folding and before EH/AB/noreturn
cleanup to get the stmt refs canonicalized.  Use a bool instead
of gimple_modified_p since that doesn't work for NOPs.  Schedule
NOPs generated by folding for removal.

* g++.dg/torture/pr82060.C: New testcase.

Added:
trunk/gcc/testsuite/g++.dg/torture/pr82060.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/testsuite/ChangeLog
trunk/gcc/tree-ssa-pre.c

[Bug tree-optimization/82060] [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

2017-09-01 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #2 from Martin Liška  ---
Started with r246866, maybe useful info.

[Bug tree-optimization/82060] [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

2017-09-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2017-09-01
   Assignee|unassigned at gcc dot gnu.org  |rguenth at gcc dot 
gnu.org
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
#1  0x01329897 in refs_may_alias_p_1 (ref1=0x7fffd4b0, 
ref2=0x7fffd2a0, tbaa_p=true) at /tmp/trunk2/gcc/tree-ssa-alias.c:1538
1538  gcc_unreachable ();
(gdb) p ref2->ref
$3 = 
(gdb) p ref2->base
$4 = 

because

(gdb) p debug_gimple_stmt (stmt)
# .MEM_10 = VDEF <.MEM_4>
MEM[(struct B *)].ma = OBJ_TYPE_REF(_2;(struct D)d_6(D)->0) (d_6(D));
$11 = void

has an unfolded LHS:

 
...
arg:0 
public unsigned DI
size 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set 1 canonical-type
0x769e83f0>

arg:0 

arg:0 

arg:0 
arg:0 >

propagated by PRE.  So this ends up running into


  /* Visit indirect calls and turn them into direct calls if
 possible using the devirtualization machinery.  */
  if (gcall *call_stmt = dyn_cast  (stmt))
{

before we fold (and thus canonicalize) the stmt:

  if (gimple_modified_p (stmt))
{
...

[Bug tree-optimization/82060] [7/8 Regression] ICE in refs_may_alias_p_1 with devirtualization enabled

2017-08-31 Thread pinskia at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060

Andrew Pinski  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
   Target Milestone|--- |7.3