This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH/expand] PR64011 Adjust bitsize when partial overflow happen for big-endian


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
>>
>>
>>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]