Mail Archives: djgpp/1996/06/12/00:32:33
On Tue, 11 Jun 1996 09:43:15 GMT, Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
wrote:
: That's why lib/specs in DJGPP disables that optimization. You have to
: use -fstrength-reduce on the gcc command line to switch it on.
:
: > Also is gcc v2.6.3 got this bug?
:
: No.
Is this really true? I was the person who first found the bug while using
2.5.4 under Linux. I upgraded to 2.6.3 and the bug was still there. It is
my understanding that the bug afflicts all versions of gcc on intel.
For what it is worth, here is some code that illustrates the bug. Compile
and run it using `gcc -O2 -fno-strength-reduce' and
`gcc -O2 -fstrength-reduce'.
#include <stdio.h>
int I[3];
unsigned int Num_I = 3;
void print_i (void)
{
unsigned int j;
for (j = 0; j < 3; j++)
{
fprintf (stderr, "I[%d] = %d\n", j, I[j]);
}
}
int main ()
{
unsigned int j;
for (j = 0; j < Num_I; j++)
{
I[j] = (int)j - 3;
}
print_i ();
return 0;
}
--
John E. Davis Center for Space Research/AXAF Science Center
617-258-8119 MIT 37-662c, Cambridge, MA 02139
http://space.mit.edu/~davis
- Raw text -