Re: [PATCH v4] tree-optimization/94899: Remove "+ 0x80000000" in int comparisons

2022-06-21 Thread Richard Biener via Gcc-patches
On Mon, Jun 20, 2022 at 4:23 PM 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 i

[PATCH v4] tree-optimization/94899: Remove "+ 0x80000000" in int comparisons

2022-06-20 Thread Arjun Shankar via Gcc-patches
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