* Can't find gcc bugzilla
@ 2005-05-28 15:09 Tim Wesson
2005-05-29 0:01 ` Eljay Love-Jensen
0 siblings, 1 reply; 2+ messages in thread
From: Tim Wesson @ 2005-05-28 15:09 UTC (permalink / raw)
To: gcc-help
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 */
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Can't find gcc bugzilla
2005-05-28 15:09 Can't find gcc bugzilla Tim Wesson
@ 2005-05-29 0:01 ` Eljay Love-Jensen
0 siblings, 0 replies; 2+ messages in thread
From: Eljay Love-Jensen @ 2005-05-29 0:01 UTC (permalink / raw)
To: Tim Wesson, gcc-help
Hi Tim,
What is the bug?
In C and C++, it is undefined what happens when you shift a data type equal-to-or-greater-than the number of bits of that data type.
Sincerely,
--Eljay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-05-29 0:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-28 15:09 Can't find gcc bugzilla Tim Wesson
2005-05-29 0:01 ` Eljay Love-Jensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).