On Thu, 7 Mar 2024, Jakub Jelinek wrote:
> Hi!
>
> When compiling libgcc or on e.g.
> int a[64];
> int p;
>
> void
> foo (void)
> {
> int s = 1;
> while (p)
> {
> s -= 11;
> a[s] != 0;
> }
> }
> sccvn invokes UB in the compiler as detected by ubsan:
> ../../gcc/poly-int.h
Hi!
When compiling libgcc or on e.g.
int a[64];
int p;
void
foo (void)
{
int s = 1;
while (p)
{
s -= 11;
a[s] != 0;
}
}
sccvn invokes UB in the compiler as detected by ubsan:
../../gcc/poly-int.h:1089:5: runtime error: left shift of negative value -40
The problem is that w