http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53773
--- Comment #2 from rguenther at suse dot de <rguenther at suse dot de> 2012-06-26 08:35:59 UTC --- On Tue, 26 Jun 2012, jakub at gcc dot gnu.org wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53773 > > Jakub Jelinek <jakub at gcc dot gnu.org> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |jakub at gcc dot gnu.org > > --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-26 > 08:31:36 UTC --- > Seems this is vect_is_simple_reduction_1's: > if (check_reduction) > { > /* Swap operands (just for simplicity - so that the rest of the code > can assume that the reduction variable is always the last > (second) > argument). */ > if (vect_print_dump_info (REPORT_DETAILS)) > report_vect_op (def_stmt, > "detected reduction: need to swap operands: "); > > swap_tree_operands (def_stmt, gimple_assign_rhs1_ptr (def_stmt), > gimple_assign_rhs2_ptr (def_stmt)); > } > > at least on the first testcase. Now, the question is how hard would it be to > adjust the vectorizer so that it would work even without doing this swapping, > or > alternatively if we shouldn't canonicalize the operand order afterwards. Or change it to "just for simplicity - ... that the reduction variable is always the first argument.". Eventually that will wreck with reduction of MINUS_EXPR though, not sure. Richard.