[Bug middle-end/30364] [4.1 Regression] Wrong variable ranges due to constant folding
jakub at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Aug 24 16:33:00 GMT 2007
------- Comment #17 from jakub at gcc dot gnu dot org 2007-08-24 16:33 -------
Does this make sense to do this for POINTER_TYPE_P in 4.1/4.2, which
reassociate
in many other places?
I belive in 4.3 that changed with POINTER_PLUS_EXPR stuff.
struct A { int i; int v[10000]; };
int *foo (struct A *a, int x)
{
return &a->v[x - 2147483646];
}
in 4.2/4.1 gives:
foo (a, x)
{
<bb 2>:
return &a->v[0] - 4294967288B + (int *) ((unsigned int) x * 4);
}
so it will overflow (well, underflow).
E.g. on Linux kernel code this commit causes some stack size usage regressions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30364
More information about the Gcc-bugs
mailing list