Richard Guenther
23.02.10 14:41 >>> #define __RING_SIZE(_s, _sz) \ (__RD32(((_sz) - offsetof(struct netif_rx_sring, ring)) / sizeof((_s)->ring[0])))
And this was already reported as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39773 and closed as invalid.
Btw we for a long time rejected the similar
const long x = (long)((struct X *)0)->j - (long)(struct X *)0;
This one certainly doesn't compile, but considering that the member in question is an array, this struct s { int i; long l; }; #define SIZE ((long)&((struct s*)0)->l - (long)((struct s*)0)) const unsigned sz = SIZE; int arr[SIZE]; compiles fine for me with gcc 4.4.2 (and I'm pretty certain this difference is also what caused the problem with icc).
and even
struct X { int i; int j; }; char a[(long)((struct X *)0)->j - (long)(struct X *)0];
is rejected since at least GCC 2.95. It looks like you just managed to obfuscate the non-constant enough that GCC folding machinery invalidly triggered in full glory for constant expression evaluation.
Jan -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-kernel+help@opensuse.org