On Thu, Jul 21, 2011 at 2:53 PM, Andrew Stubbs <a...@codesourcery.com> wrote: > This patch is part bug fix, part better optimization. > > Firstly, my initial patch series introduced a bug that caused an internal > compiler error when the input to a multiply was a constant. This was caused > by the gimple verification rejecting such things. I'm not totally clear how > this ever worked, but I've corrected it by inserting a temporary SSA_NAME > between the constant and the multiply.
Huh? Constant operands should be perfectly fine. What was the error you got? > I also discovered that widening multiply-and-accumulate operations were not > recognised if any one of the three inputs were a constant. I've corrected > this by adjusting the pattern matching. This also required inserting new > SSA_NAMEs to make it work. See above. > In order to insert the new SSA_NAME, I've simply reused the existing type > conversion code - the only difference is that the conversion may be a no-op, > so it just generates a straight forward assignment. > > OK? Nope. I suppose you forget to adjust the constants type? Just fold-convert it before using it as input to a macc. Richard. > Andrew >