Bug#254659: gcc-2.95 for i386 loop strength reduction bug.
Package: gcc-2.95
Version: 1:2.95.4-11woody1
Severity: normal
The attatched C program will loop infinitely when compiled with
-O2 flag.
Workaround:
1. -fno-inline
2. -fno-strength-reduce
3. use gcc-3.0
*** a.c
#include <stdio.h>
inline void
h1(int *p) {
printf("%p\n", p);
}
void
h(int* p, int i) {
int j;
for(j = 0; j < 16; j++) {
h1(p + j);
}
}
int
main(int argc, char **argv) {
h((int *)0x7fffffc0, 0);
exit(0);
}
-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux brer 2.4.26-brer #2 SMP Thu May 27 11:25:10 JST 2004 i686
Locale: LANG=C, LC_CTYPE=C
Versions of packages gcc-2.95 depends on:
ii binutils 2.12.90.0.1-4 The GNU assembler, linker and bina
ii cpp-2.95 1:2.95.4-11woody1 The GNU C preprocessor.
ii gcc 2:2.95.4-14 The GNU C compiler.
ii libc6 2.2.5-11.5 GNU C Library: Shared libraries an
Reply to: