https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87608
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- Author: rguenth Date: Tue Oct 23 11:34:56 2018 New Revision: 265421 URL: https://gcc.gnu.org/viewcvs?rev=265421&root=gcc&view=rev Log: 2018-10-23 Richard Biener <rguent...@suse.de> PR tree-optimization/87105 PR tree-optimization/87608 * passes.def (pass_all_early_optimizations): Add early phi-opt after dce. * tree-ssa-phiopt.c (value_replacement): Ignore NOPs and predicts in addition to debug stmts. (tree_ssa_phiopt_worker): Add early_p argument, do only min/max and abs replacement early. * tree-cfg.c (gimple_empty_block_p): Likewise. * g++.dg/tree-ssa/phiopt-1.C: New testcase. g++.dg/vect/slp-pr87105.cc: Likewise. * g++.dg/tree-ssa/pr21463.C: Scan phiopt2 because this testcase relies on phiprop run before. * g++.dg/tree-ssa/pr30738.C: Likewise. * g++.dg/tree-ssa/pr57380.C: Likewise. * gcc.dg/tree-ssa/pr84859.c: Likewise. * gcc.dg/tree-ssa/pr45397.c: Scan phiopt2 because phiopt1 is confused by copies in the IL left by EVRP. * gcc.dg/tree-ssa/phi-opt-5.c: Likewise, this time confused by predictors. * gcc.dg/tree-ssa/phi-opt-12.c: Scan phiopt2. * gcc.dg/pr24574.c: Likewise. * g++.dg/tree-ssa/pr86544.C: Scan phiopt4. Added: trunk/gcc/testsuite/g++.dg/tree-ssa/phiopt-1.C trunk/gcc/testsuite/g++.dg/vect/slp-pr87105.cc Modified: trunk/gcc/ChangeLog trunk/gcc/passes.def trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/tree-ssa/pr21463.C trunk/gcc/testsuite/g++.dg/tree-ssa/pr30738.C trunk/gcc/testsuite/g++.dg/tree-ssa/pr57380.C trunk/gcc/testsuite/g++.dg/tree-ssa/pr86544.C trunk/gcc/testsuite/gcc.dg/pr24574.c trunk/gcc/testsuite/gcc.dg/tree-ssa/20040514-1.c trunk/gcc/testsuite/gcc.dg/tree-ssa/20040518-1.c trunk/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-12.c trunk/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-5.c trunk/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-6.c trunk/gcc/testsuite/gcc.dg/tree-ssa/phi-opt-8.c trunk/gcc/testsuite/gcc.dg/tree-ssa/popcount3.c trunk/gcc/testsuite/gcc.dg/tree-ssa/pr45397.c trunk/gcc/testsuite/gcc.dg/tree-ssa/pr84859.c trunk/gcc/testsuite/gcc.dg/uninit-15.c trunk/gcc/tree-cfg.c trunk/gcc/tree-ssa-phiopt.c