[PATCH] mips: avoid signed overflow in LUI_OPERAND [PR104842]

Xi Ruoyao xry111@mengyan1223.wang
Wed Mar 9 10:59:25 GMT 2022


On Tue, 2022-03-08 at 18:20 +0000, Richard Sandiford wrote:
> Xi Ruoyao <xry111@mengyan1223.wang> writes:
> > I think this one obvious.  Ok for trunk?

> OK, thanks.

Committed r12-7555.

/* snip */

> >  #define LUI_OPERAND(VALUE)                                     \
> >    (((VALUE) | 0x7fff0000) == 0x7fff0000                                \
> > -   || ((VALUE) | 0x7fff0000) + 0x10000 == 0)
> > +   || ((unsigned HOST_WIDE_INT) (VALUE) | 0x7fff0000) + 0x10000 == 0)

-- 
Xi Ruoyao <xry111@mengyan1223.wang>
School of Aerospace Science and Technology, Xidian University


More information about the Gcc-patches mailing list