------- Comment #3 from wilson at codesourcery dot com 2010-05-03 22:28 ------- Subject: Re: suboptimal MIPS widening multiply accumulate
On Tue, 2010-04-27 at 09:33 +0000, rguenth at gcc dot gnu dot org wrote: > For more general optimization you might want to move all this code to > the tree pass before expansion that detects widening multiplication. > The DOT_PROD_EXPR tree code can be used to carry the information to > the expander. I didn't understand the point here at first, but after updating my tree and rebuilding I now see Bernd's patch to add the new widening_mul optimization pass which I hadn't noticed before. The MIPS macc/madd support is now even more broken than before. I can generate them at -O but not at -O2 now, as the code in expand_expr_real_2 doesn't handle WIDEN_MULT_EXPR which is created at -O2 by the new code. So as Richard Guenther mentioned, the solution seems to be to remove the old code in expand_expr_real_2 and add something new in tree-ssa-math-opt.c to replace it. This means we won't be able to generate widening multiply accumulate with -O, but we will at -O2. This is probably acceptable, though it makes the solution more complicated than I had originally expected. Jim -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43902