On Fri, Feb 4, 2022 at 12:50 PM Jakub Jelinek wrote:
>
> On Fri, Feb 04, 2022 at 12:14:33PM +0100, Richard Biener via Gcc-patches
> wrote:
> > +#define MAGIC 0x8000
> >
> > I _think_ writing the constant this way requires
>
> Perhaps use (~(uint32_t)0 / 2 + 1) as MAGIC instead?
> Then it does
On Fri, Feb 04, 2022 at 12:14:33PM +0100, Richard Biener via Gcc-patches wrote:
> +#define MAGIC 0x8000
>
> I _think_ writing the constant this way requires
Perhaps use (~(uint32_t)0 / 2 + 1) as MAGIC instead?
Then it doesn't actually require that uint32_t actually is exactly 32 bits.
On the
On Thu, Feb 3, 2022 at 4:50 AM Arjun Shankar wrote:
>
> Expressions of the form "X + CST < Y + CST" where:
>
> * CST is an unsigned integer constant with only the MSB set, and
> * X and Y's types have integer conversion ranks <= CST's
>
> can be simplified to "(signed) X < (signed) Y".
>
> This is
Expressions of the form "X + CST < Y + CST" where:
* CST is an unsigned integer constant with only the MSB set, and
* X and Y's types have integer conversion ranks <= CST's
can be simplified to "(signed) X < (signed) Y".
This is because, assuming a 32-bit signed numbers,
(unsigned) INT_MIN + 0x8