Bug 21376 - Severe fortran optimization error
Summary: Severe fortran optimization error
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2000-11-27 15:56 UTC by Alfredo Ferrari
Modified: 2005-10-31 22:00 UTC (History)
0 users

Clone Of:
Last Closed: 2000-11-28 13:42:20 UTC

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2000:132 normal SHIPPED_LIVE Bug fixing update of GCC 2.96 2000-12-19 05:00:00 UTC

Description Alfredo Ferrari 2000-11-27 15:56:21 UTC
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.

      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

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

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

g77 -O -o bug bug.f
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

Comment 1 Jakub Jelinek 2000-11-28 13:42:17 UTC
Thanks for reporting this, I've fixed this in
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.

Comment 2 Jakub Jelinek 2000-12-14 16:18:11 UTC
Fixed in 2.96-65 and above.

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