https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82060
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Mon Sep 4 10:57:20 2017 New Revision: 251650 URL: https://gcc.gnu.org/viewcvs?rev=251650&root=gcc&view=rev Log: 2017-09-04 Richard Biener <rguent...@suse.de> 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