https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71114
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Reduced test #include <limits.h> extern void abort(void); extern void exit(int); #define BITS 8 static unsigned long long const data[8] = { 0x123456789abcdefULL, 0x2468acf13579bdeULL, 0x48d159e26af37bcULL, 0x91a2b3c4d5e6f78ULL, 0x123456789abcdef0ULL, 0x2468acf13579bde0ULL, 0x48d159e26af37bc0ULL, 0x91a2b3c4d5e6f780ULL }; static unsigned long long variable_shift(unsigned long long x, int i) { return x << i; } int main() { int i; for (i = 0; i < BITS; ++i) { unsigned long long y = variable_shift (data[0], i); if (y != data[i]) abort (); } exit (0); } It succeeds if I replace '#define BITS 8' with '#define BITS 7'.