This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH (9/7)] Widening multiplies with constant inputs
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andrew Stubbs <ams at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org, patches at linaro dot org
- Date: Thu, 21 Jul 2011 15:22:28 +0200
- Subject: Re: [PATCH (9/7)] Widening multiplies with constant inputs
- References: <4E034EF2.3070503@codesourcery.com> <4E282148.9080100@codesourcery.com>
On Thu, Jul 21, 2011 at 2:53 PM, Andrew Stubbs <ams@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
>