https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89595
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Thu Mar 7 12:46:44 2019 New Revision: 269453 URL: https://gcc.gnu.org/viewcvs?rev=269453&root=gcc&view=rev Log: 2019-03-07 Richard Biener <rguent...@suse.de> PR tree-optimization/89595 * tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Take stmt iterator as reference, take boolean output parameter to indicate whether the stmt was removed and thus the iterator already advanced. (dom_opt_dom_walker::before_dom_children): Re-iterate over stmts created by folding. * gcc.dg/torture/pr89595.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr89595.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-dom.c