From 25c6036a5bc49ba73bc3f5d2573cf2506b513a1f Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 13 Aug 2008 08:57:20 +0000 Subject: re PR tree-optimization/15255 ([tree-ssa] a * 2 + a * 2 is not converted to a * 4) 2008-08-13 Richard Guenther PR tree-optimization/15255 * tree-ssa-reassoc.c (linearize_expr_tree): Declare. (struct oecount_s): New struct and VEC types. (cvec): New global. (oecount_hash): New function. (oecount_eq): Likewise. (oecount_cmp): Likewise. (zero_one_operation): New function. (build_and_add_sum): Likewise. (undistribute_ops_list): Perform un-distribution of multiplication and division on the chain of summands. (should_break_up_subtract): Also break up subtracts for factors. (reassociate_bb): Delete dead visited statements. Call undistribute_ops_list. Re-sort and optimize if it did something. * passes.c (init_optimization_passes): Move DSE before reassociation. * tree-ssa-loop-niter.c (stmt_dominates_stmt_p): Correctly handle PHI nodes. * gcc.dg/tree-ssa/reassoc-14.c: New testcase. * gcc.dg/tree-ssa/reassoc-15.c: Likewise. * gcc.dg/tree-ssa/reassoc-16.c: Likewise. * gcc.dg/torture/reassoc-1.c: Likewise. * gcc.dg/tree-ssa/recip-2.c: Adjust. * gcc.dg/tree-ssa/recip-6.c: Likewise. * gcc.dg/tree-ssa/recip-7.c: Likewise. * gfortran.dg/reassoc_4.f: Likewise. From-SVN: r139048 --- gcc/passes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gcc/passes.c') diff --git a/gcc/passes.c b/gcc/passes.c index 64470ba..ee3826b 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -633,9 +633,9 @@ init_optimization_passes (void) only examines PHIs to discover const/copy propagation opportunities. */ NEXT_PASS (pass_phi_only_cprop); + NEXT_PASS (pass_dse); NEXT_PASS (pass_reassoc); NEXT_PASS (pass_dce); - NEXT_PASS (pass_dse); NEXT_PASS (pass_forwprop); NEXT_PASS (pass_phiopt); NEXT_PASS (pass_object_sizes); -- cgit v1.1