2017-12-15 Richard Biener <rguenther@suse.de>
Backport from mainline
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@255682 138bc75d-0d04-0410-961f-82ee72b054a4