This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Use gen_int_mode in plus_constant
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>,gcc-patches at gcc dot gnu dot org
- Date: Tue, 30 Apr 2013 18:01:38 +0200
- Subject: Re: RFA: Use gen_int_mode in plus_constant
- References: <87wqrk5aoa dot fsf at sandifor-thinkpad dot stglab dot manchester dot uk dot ibm dot com>
Richard Sandiford <rsandifo@linux.vnet.ibm.com> wrote:
>This patch fixes out the GEN_INT/gen_int_mode that Richard pointed out
>in the wide-int review. It also passes "mode" rather than "VOIDmode"
>to immed_double_int_const. (As discussed in that thread, the latter
>change shouldn't make any difference in practice, but is still more
>correct in principle.)
>
>Bootstrapped & regression-tested on x86_64-linux-gnu. OK to install?
Ok.
Thanks,
Richard.
>Richard
>
>gcc/
> * explow.c (plus_constant): Pass "mode" to immed_double_int_const.
> Use gen_int_mode rather than GEN_INT.
>
>Index: gcc/explow.c
>===================================================================
>--- gcc/explow.c 2013-02-25 09:41:58.000000000 +0000
>+++ gcc/explow.c 2013-04-30 15:52:57.270362112 +0100
>@@ -106,10 +106,10 @@ plus_constant (enum machine_mode mode, r
> if (overflow)
> gcc_unreachable ();
>
>- return immed_double_int_const (v, VOIDmode);
>+ return immed_double_int_const (v, mode);
> }
>
>- return GEN_INT (INTVAL (x) + c);
>+ return gen_int_mode (INTVAL (x) + c, mode);
>
> case CONST_DOUBLE:
> {
>@@ -124,7 +124,7 @@ plus_constant (enum machine_mode mode, r
> To fix, add constant support wider than CONST_DOUBLE. */
> gcc_assert (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_DOUBLE_INT);
>
>- return immed_double_int_const (v, VOIDmode);
>+ return immed_double_int_const (v, mode);
> }
>
> case MEM: