g77-20000626 miscompilation of nested loops at -Os -funroll-loops (x86)
Tim Prince
tprince@computer.org
Tue Jun 27 18:46:00 GMT 2000
This bug has remained in gcc-2.96 for months; all other bugs which I have reported have been fixed. The two nested loop groups from
Livermore Fortran Kernels which are being miscompiled are isolated in the files k18a.f and k23.f. These files continue to compile
correctly with all options tested under gcc-2.95.2, and fail under gcc-2.96 only with the combination -Os -funroll-loops. The
options -march=pentiumpro and -ffast-math make no difference, and correct results are obtained without -funroll-loops, with the
combinations -O -funroll-loops, -O2 -funroll-loops, and with a subroutine call inserted to avoid having nested loops in one
compilation unit. The fact that these examples have a fixed count on the outer loop appears to be coincidental; making them
variable does not affect the problem. If the fixed count outer loop is unrolled in source code, that also eliminates the problem.
Tim Prince
-------------- next part --------------
A non-text attachment was scrubbed...
Name: k18a.f
Type: text/x-fortran
Size: 846 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000627/f2884c74/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: k23.f
Type: text/x-fortran
Size: 824 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000627/f2884c74/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kb.f
Type: text/x-fortran
Size: 19116 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000627/f2884c74/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llnk.f.gz
Type: application/x-gzip
Size: 66598 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20000627/f2884c74/attachment-0003.bin>
More information about the Gcc-bugs
mailing list