This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR41738 optabs expands rotate using wrong mode
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Andy H <hutchinsonandy at aim dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 18 Oct 2009 00:31:26 +0200
- Subject: Re: [PATCH] Fix PR41738 optabs expands rotate using wrong mode
- References: <4ADA303C.3050506@aim.com>
On Sat, Oct 17, 2009 at 10:59 PM, Andy H <hutchinsonandy@aim.com> wrote:
>
> The following patch corrects the mode of the shift count expression created
> by expand_binop and fixes PR41738
>
> Tested on 4.5 head Native configuration ?i686-pc-linux-gnu with no
> regressions.
>
>
> Ok?
Ok.
Thanks,
Richard.
>
> 2009-10-17 ?Andy Hutchinson <hutchinsonandy@gcc.gnu.org>
>
> ?PR middle-end/41738
> ?* optabs.c (expand_binop): Make mode of shift count expression mode of
> shift count not target
> ?Remove indent nit.
>
>
> Index: optabs.c
> ===================================================================
> --- optabs.c ? ?(revision 152955)
> +++ optabs.c ? ?(working copy)
> @@ -1595,11 +1595,11 @@
> ? ? ?unsigned int bits = GET_MODE_BITSIZE (mode);
>
> ? ? ?if (CONST_INT_P (op1))
> - ? ?newop1 = GEN_INT (bits - INTVAL (op1));
> + ? ? ? ?newop1 = GEN_INT (bits - INTVAL (op1));
> ? ? ?else if (targetm.shift_truncation_mask (mode) == bits - 1)
> - ? ?newop1 = negate_rtx (mode, op1);
> + ? ? ? ?newop1 = negate_rtx (GET_MODE (op1), op1);
> ? ? ?else
> - ? ?newop1 = expand_binop (mode, sub_optab,
> + ? ? ? ?newop1 = expand_binop (GET_MODE (op1), sub_optab,
> ? ? ? ? ? ? ? ? ? GEN_INT (bits), op1,
> ? ? ? ? ? ? ? ? ? NULL_RTX, unsignedp, OPTAB_DIRECT);
>
>
>
>