Andreas Krebbel <kreb...@linux.vnet.ibm.com> writes:
> On 30/04/13 16:56, Richard Sandiford 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?
>> 
>> 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);
>
> This calls trunc_int_for_mode which fails for mode == VOIDmode.
> On s390x gcc.c-torture/compile/20021008-1.c fails due to this.

But it's invalid to pass mode == VOIDmode to plus_constant too.
Which caller is causing trouble?

Thanks,
Richard

Reply via email to