On Thu, Apr 5, 2012 at 6:49 AM, William J. Schmidt <wschm...@linux.vnet.ibm.com> wrote: > On Thu, 2012-04-05 at 11:23 +0200, Richard Guenther wrote: >> On Wed, Apr 4, 2012 at 9:15 PM, William J. Schmidt >> <wschm...@linux.vnet.ibm.com> wrote: >> > >> > Unfortunately this seems to be necessary if I name the two passes >> > "reassoc1" and "reassoc2". If I try to name both of them "reassoc" I >> > get failures in other tests like gfortran.dg/reassoc_4, where >> > -fdump-tree-reassoc1 doesn't work. Unless I'm missing something >> > obvious, I think I need to keep that change. >> >> Hm, naming them "reassoc1" and "reassoc2" is a hack. Naming both >> "reassoc" will not trigger re-naming them to reassoc1 and reassoc2 >> I think. How ugly. Especially that -fdump-tree-reassoc will no longer >> work. Maybe instead of using two pass structs resort to using >> the existing hack with using first_pass_instance and >> TODO_mark_first_instance. > > OK, that seems to be the best among evils. Using the > first_pass_instance hack, the patch is transformed as below. > Regstrapped on powerpc64-linux, no additional failures. OK for trunk? > > Thanks, > Bill > > > gcc: > > 2012-04-05 Bill Schmidt <wschm...@linux.vnet.ibm.com> > > PR tree-optimization/18589 > * tree-ssa-reassoc.c (reassociate_stats): Add two fields. > (operand_entry): Add count field. > (add_repeat_to_ops_vec): New function. > (completely_remove_stmt): Likewise. > (remove_def_if_absorbed_call): Likewise. > (remove_visited_stmt_chain): Remove feeding builtin pow/powi calls. > (acceptable_pow_call): New function. > (linearize_expr_tree): Look for builtin pow/powi calls and add operand > entries with repeat counts when found. > (repeat_factor_d): New struct and associated typedefs. > (repeat_factor_vec): New static vector variable. > (compare_repeat_factors): New function. > (get_reassoc_pow_ssa_name): Likewise. > (attempt_builtin_powi): Likewise. > (reassociate_bb): Call attempt_builtin_powi. > (fini_reassoc): Two new calls to statistics_counter_event. >
It breaks bootstrap on Linux/ia32: ../../src-trunk/gcc/tree-ssa-reassoc.c: In function 'void attempt_builtin_powi(gimple, VEC_operand_entry_t_heap**, tree_node**)': ../../src-trunk/gcc/tree-ssa-reassoc.c:3189:41: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Werror=format] fprintf (dump_file, ")^%ld\n", power); ^ ../../src-trunk/gcc/tree-ssa-reassoc.c:3222:44: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'long long int' [-Werror=format] fprintf (dump_file, ")^%ld\n", power); ^ cc1plus: all warnings being treated as errors H.J.