Mail Archives: pgcc/1998/05/10/03:39:12
Greetings.
This problem happens when I use -funroll-all-loops. Here is a small test
program that shows what is happening:
(incorrect result):
godot [1] leland> cc -O6 -mpentiumpro -malign-double -mstack-align-double -funroll-all-loops t1.c
godot [2] leland> a.out
da1 = 5
after loop, da1 = -1
(correct result):
godot [3] leland> cc -O6 -mpentiumpro -malign-double -mstack-align-double t1.c
godot [4] leland> a.out
da1 = 5
after loop, da1 = 1
Here is the test program in question:
-----------------------------
#include <stdio.h>
int a[] = { 1, 3, 0, 0, 0, 1 };
main() {
int da1 = 5;
printf ("da1 = %d\n", da1);
while (--da1 >= 0 && !a[da1]);
printf ("after loop, da1 = %d\n", da1);
}
Version information:
godot [7] leland> gcc -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/pgcc-2.91.24/specs
gcc version pgcc-2.91.24 19980418 (gcc2 ss-980401 experimental)
godot [8] leland>
-------------------------------------------
Leland Ray
Manager, Release Engineering
Wolfram Research, Inc.
leland AT wolfram DOT com
- Raw text -