I'm a bit out of touch, having not programmed for a few years. I have found a simple bug in gcc 3.4.3, and don't know who to report it to, or how many others have already reported it. I tried reporting it to Red Hat (as it appears to have been modified by them), but it appears that I need an account so as to be able to report a bug! As the program is short easy to test, and likely to reflect a bug in the pre-modified code, I thought that it would cost little, and perhaps save time to post the test program with this request for help reporting bugs. Thanks in advance, Tim Wesson. - gcc_bug.c below /* bug in shift-left. > gcc gcc_bug.c -o gcc_bug ./gcc_bug shift: 1 (1ll << shift): 2 shift: 2 (1ll << shift): 4 shift: 3 (1ll << shift): 8 shift: 4 (1ll << shift): 16 shift: 5 (1ll << shift): 32 shift: 6 (1ll << shift): 64 shift: 7 (1ll << shift): 128 shift: 8 (1ll << shift): 256 shift: 9 (1ll << shift): 512 shift: 10 (1ll << shift): 1024 shift: 11 (1ll << shift): 2048 shift: 12 (1ll << shift): 4096 shift: 13 (1ll << shift): 8192 shift: 14 (1ll << shift): 16384 shift: 15 (1ll << shift): 32768 shift: 16 (1ll << shift): 65536 shift: 17 (1ll << shift): 131072 shift: 18 (1ll << shift): 262144 shift: 19 (1ll << shift): 524288 shift: 20 (1ll << shift): 1048576 shift: 21 (1ll << shift): 2097152 shift: 22 (1ll << shift): 4194304 shift: 23 (1ll << shift): 8388608 shift: 24 (1ll << shift): 16777216 shift: 25 (1ll << shift): 33554432 shift: 26 (1ll << shift): 67108864 shift: 27 (1ll << shift): 134217728 shift: 28 (1ll << shift): 268435456 shift: 29 (1ll << shift): 536870912 shift: 30 (1ll << shift): 1073741824 shift: 31 (1ll << shift): 2147483648 shift: 32 (1ll << shift): 4294967296 shift: 33 (1ll << shift): 8589934592 shift: 34 (1ll << shift): 17179869184 shift: 35 (1ll << shift): 34359738368 shift: 36 (1ll << shift): 68719476736 shift: 37 (1ll << shift): 137438953472 shift: 38 (1ll << shift): 274877906944 shift: 39 (1ll << shift): 549755813888 shift: 40 (1ll << shift): 1099511627776 shift: 41 (1ll << shift): 2199023255552 shift: 42 (1ll << shift): 4398046511104 shift: 43 (1ll << shift): 8796093022208 shift: 44 (1ll << shift): 17592186044416 shift: 45 (1ll << shift): 35184372088832 shift: 46 (1ll << shift): 70368744177664 shift: 47 (1ll << shift): 140737488355328 shift: 48 (1ll << shift): 281474976710656 shift: 49 (1ll << shift): 562949953421312 shift: 50 (1ll << shift): 1125899906842624 shift: 51 (1ll << shift): 2251799813685248 shift: 52 (1ll << shift): 4503599627370496 shift: 53 (1ll << shift): 9007199254740992 shift: 54 (1ll << shift): 18014398509481984 shift: 55 (1ll << shift): 36028797018963968 shift: 56 (1ll << shift): 72057594037927936 shift: 57 (1ll << shift): 144115188075855872 shift: 58 (1ll << shift): 288230376151711744 shift: 59 (1ll << shift): 576460752303423488 shift: 60 (1ll << shift): 1152921504606846976 shift: 61 (1ll << shift): 2305843009213693952 shift: 62 (1ll << shift): 4611686018427387904 shift: 63 (1ll << shift): -9223372036854775808 shift: 64 (1ll << shift): 1 shift: 65 (1ll << shift): 2 shift: 66 (1ll << shift): 4 [...] > gcc --version gcc (GCC) 3.4.3 20050227 (Red Hat 3.4.3-22.fc3) [...] > uname -a Linux localhost.localdomain 2.6.11-1.14_FC3 #1 Thu Apr 7 19:23:49 EDT 2005 i686 athlon i386 GNU/Linux */ #include <stdio.h> int main (void) { int shift; for (shift = 1; 0ll != (1ll << shift); /* bug in gcc */ shift++) fprintf (stderr, "shift:\t%d\t\t" "(1ll << shift):\t%lld\n", shift, (1ll << shift)); return (0); /* never get here */ }