This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH/expand] PR64011 Adjust bitsize when partial overflow happen for big-endian
- From: Jiong Wang <wong dot kwongyuan dot tools at gmail dot com>
- To: Jiong Wang <jiong dot wang at arm dot com>
- Cc: Jeff Law <law at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 9 Jan 2015 18:45:24 +0000
- Subject: Re: [PATCH/expand] PR64011 Adjust bitsize when partial overflow happen for big-endian
- Authentication-results: sourceware.org; auth=none
- References: <54A27CBA dot 8080609 at arm dot com> <54AF6B36 dot 5090305 at redhat dot com> <54AFD9F8 dot 5060202 at arm dot com>
2015-01-09 13:39 GMT+00:00 Jiong Wang <jiong.wang@arm.com>:
>
> the following code in store_bit_field_using_insv haven't consider above
> MEM->REG situation,
> it always assume bitnum + bitsize is within unit which is wrong.
> if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
> bitnum = unit - bitsize - bitnum;
>
> while my patch do have a problem, I should restrict the check on
> REG_P/SUBREG_P (op0) only.
> so is the patch OK with on extra check
>
> if (REG_P (xop0) || (SUBREG_P (xop0) && REG_P (SUBREG_REG (xop0))))
sorry, this extra check should be unnecessary. because the following
check will only
be true if the destination is register.
+ if (bitsize + bitnum > unit && bitnum < unit)
+ bitsize = unit - bitnum;
so I think the original patch is OK?
thanks.
Regards,
Jiong
>
> Regards,
> Jiong
>
>>
>> jeff
>>
>>
>>
>
>