Subject: Re: gcc 2.7.2 -fstrength-reduce bug?
To: Michael Graff <explorer@flame.org>
From: Dave Huang <khym@bga.com>
List: port-i386
Date: 12/31/1995 04:16:35
On Sun, 31 Dec 1995, Michael Graff wrote:
> What kind of trouble? I've compiled kernels with 2.7.2 and have had
> no problems I can attribute to 2.7.2.
I don't know if the bug actually causes any problems in the kernel, but
it seems like it's possible... I've been running with 2.7.2-compiled
kernels since the switch was made, and haven't had any problems either,
so perhaps the bug doesn't get triggered. I've recompiled with
-fno-strength-reduce just to be safe though :)
Here's a short little program (found on gnu.gcc.bug... I don't know who
the original author is) that demonstrates the bug. Try compiling it with
-O, -O2, and -O2 -fno-strength-reduce.
int A[3];
unsigned int B = 3;
void printit(void)
{
int i;
for(i = 0; i < B; i++)
printf("A[%d] = %d\n", i, A[i]);
}
int main()
{
int i;
for(i = 0; i < B; i++)
A[i] = i-3;
printit();
return 0;
}
--
Name: Dave Huang | Mammal, mammal / their names are called /
INet: khym@bga.com | they raise a paw / the bat, the cat /
FurryMUCK: Dahan | dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 20 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++