Bug 21376 - Severe fortran optimization error
Severe fortran optimization error
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
high Severity high
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-27 10:56 EST by Alfredo Ferrari
Modified: 2005-10-31 17:00 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-28 08:42:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Alfredo Ferrari 2000-11-27 10:56:21 EST
The g77 compiler shipped with RH7 is badly broken and almost unusable. The
following bug reported on the gcc-bugs list originally by Martin Kahlert as
a bug of the last snapshot is actually there in all snapshots I tried after
the gcc-2.95.2 release and in particular in the "gcc-2.96" shipped with
RedHat. It is practically impossible to compile correctly a medium/large
fortran code on RH7 because of this. I work at CERN and our MonteCarlo code
got *AT LEAST* seven miscompiled routines after a quick check (by the way
all our codes dump core within a minute because of this). Two of these
bugs are related to the example reported below, I quit to investigate the
others since until this one is fixed there is no point in wasting further
time (hopefully they are still the same problem). The bug has been reported
to gcc-bugs as fortran/893 by somebody else.
If it can be of any help, gcc-g77-2.95.2 compiles correctly the example,
proving how crazy RedHat was in sending out an official release with a very
poor and unchecked snapshot as compiler. At present no work of fortran
based scientific computation can be performed with RH7. The bugs disappear
switching off all optimizations but the CPU penalties are of course
unacceptable. Due to the severity of the problem(s) perhaps it would be
wise to warn thru the lists all fortran users and maybe provide an "ad hoc"
solution with an older compiler set for fortran (gcc-2.95.2 based?) built
for RH7 while waiting for a fix.

      PROGRAM BUG
      REAL*8 VALUE(3), TOLD, BK
      DATA VALUE /0D0, 1D0, 2D0/
      DATA TOLD /0D0/

      DO I=1, 3
         BK = VALUE(I)
         IF(BK .GT. TOLD) GOTO 10
      ENDDO

      WRITE(*,*) 'Error: BK = ', BK
      STOP

 10   CONTINUE
      WRITE(*,*) 'No Error: BK = ', BK
      END

g77 -O -o bug bug.f
./bug
Error: BK = 1.


 Alfredo Ferrari                         ||  Tel.: +41.22.767.6119         
 C.E.R.N.                                ||  Fax.:
+41.22.767.7555           European Laboratory for Particle Physics||
 SL Division / EET Project               ||  e-mail:
 1211 Geneva 23                          ||     Alfredo.Ferrari@cern.ch
 Switzerland
Comment 1 Jakub Jelinek 2000-11-28 08:42:17 EST
Thanks for reporting this, I've fixed this in
http://gcc.gnu.org/ml/gcc-patches/2000-11/msg01594.html
and am now waiting for feedback from other gcc developers before
I put it into RH rpms.
If you have any other issues, please report them as well.
Thanks.
Comment 2 Jakub Jelinek 2000-12-14 11:18:11 EST
Fixed in 2.96-65 and above.

Note You need to log in before you can comment on or make changes to this bug.