This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: fortran/893: Preliminary loop exit compiled wrongly


Hi

I want to stress that the bug reported below is very serious and it is
present in all snapshots of gcc after gcc-2.95.2 (the last one I tested
being

g77 version 2.97 20001125 (experimental) (Fortran Frontend version 0.5.26 20001125 (experimental))
)

gcc-2.95.2 is still compiling correctly that example.

When I mean serious, I mean that for our codes (MonteCarlo's for high
energy physics) there are bugs popping up everywhere. I found at least
7 different miscompiled routines in a few minutes. Inspections of the
first two showed problems similar to the example below. I am not
sure all problems are related to this bug only, however I see no point
in going on before getting a patch.

Of course all problems disappear compiling with the (old) egcs-1.1.2
and at least for those two routines I investigated, using gcc-2.95.2.
Unfortunately the (in)famous snapshot ("gcc-2.96") delivered with RedHat 7
contains the bug as well. Actually this is the reason why I found the
bugs. I know all the story about that (non)release, however since the
bug is still there in the current tree and a lot of (fortran) users will
run into it as soon as they will use RH7, it would be nice to have a fix
which could be applied back as well. Otherwise RH7 will be good for the
trash only for those doing scientific computation with fortran.
Needless to say, switching off all optimizations makes all bugs disappear,
however the penalty for the CPU is huge and unacceptable.

I have a question (in order to try to survive meanwhile);
is there any known incompatibility/patch I have to take care of in order
to rebuild correctly gcc-2.95.2 on a system running glibc-2.2 (RH7)?
And in case this can be done, which are the binary incompatibilities
(we link together c and fortran modules and sometimes c++ ones)?

                        Thanks a lot
                       Alfredo Ferrari


+----------------------------------------------------------------------------+
|  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                             ||     Alfredo.Ferrari@mi.infn.it |
+----------------------------------------------------------------------------+



On 26 Nov 2000 toon@moene.indiv.nluug.nl wrote:

>
> >Number:         893
> >Category:       fortran
> >Synopsis:       Preliminary loop exit compiled wrongly
> >Confidential:   no
> >Severity:       serious
> >Priority:       high
> >Responsible:    unassigned
> >State:          open
> >Class:          sw-bug
> >Submitter-Id:   net
> >Arrival-Date:   Sun Nov 26 08:36:00 PST 2000
> >Closed-Date:
> >Last-Modified:
> >Originator:     Martin Kahlert
> >Release:        current snapshots
> >Organization:
> >Environment:
> i?86-linux
> >Description:
> The following code:
>
>       DOUBLE PRECISION VALUE(2), TOLD, BK
>       DATA VALUE /0D0, 1D0/
>       DATA TOLD /0D0/
>       DO I=1, 2
>          BK = VALUE(I)
>          IF(BK .GT. TOLD) GOTO 10
>       ENDDO
>       WRITE(*,*)'Error: BK = ', BK
>       CALL ABORT
>  10   CONTINUE
>       WRITE(*,*)'No Error: BK = ', BK
>       END
>
> which is g77 (execute) testsuite item 20001111.f compiles
> wrongly on i?86-linux with any optimisation on.
> >How-To-Repeat:
> g77 -O 20001111.f
>
> on i?86-linux
> >Fix:
>
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]