------- 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