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]

Possible bug in FORTRAN g77 frontend


Dear developers,

It seems to me that I've encountered the bug in g77,
see very simple example from real program:

file bug.f
-----------------------------------------------------------------
      subroutine nbinterp (lratio, strip, strip_lo, strip_hi)

      integer lratio(3)
      integer strip_lo, strip_hi
      real*8  strip(strip_lo: strip_hi, 0:lratio(2), 0:lratio(3))

      return
      end
-----------------------------------------------------------------

Compiler choked with the messages:
_________________________________________________________________

g77 version egcs-2.92.21 19981110 (gcc2 ss-980609 experimental) (from FSF-g77 version 0.5.24-19980804)
Driving: eg77 -v bug.f -lg2c -lm
Reading specs from /home/spike/egcs-gas-bin/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.92.21/specs
gcc version egcs-2.92.21 19981110 (gcc2 ss-980609 experimental)
 /home/spike/egcs-gas-bin/lib/gcc-lib/sparc-sun-solaris2.5.1/egcs-2.92.21/f771 bug.f -quiet -dumpbase bug.f -version -fversion -o /var/tmp/cc0REeaT.s
GNU F77 version egcs-2.92.21 19981110 (gcc2 ss-980609 experimental) (sparc-sun-solaris2.5.1) compiled by GNU C version egcs-2.92.21 19981110 (gcc2 ss-980609 experimental).
GNU Fortran Front End version 0.5.24-19980804
bug.f: In subroutine `nbinterp':
bug.f:1: 
         subroutine nbinterp (lratio, strip, strip_lo, strip_hi)
                              1
bug.f:5: (continued):
         real*8  strip(strip_lo: strip_hi, 0:lratio(2), 0:lratio(3))
                                             2
Invalid declaration of or reference to symbol `lratio' at (2) [initially seen at (1)]
bug.f:1: 
         subroutine nbinterp (lratio, strip, strip_lo, strip_hi)
                                      1
bug.f:7: (continued):
         return
         2
Invalid declaration of or reference to symbol `strip' at (2) [initially seen at (1)]
-----------------------------------------------------------------------

But nevertheless f2c compiles it quetly:

file bug.c
-----------------------------------------------------------------------
/* bug.f -- translated by f2c (version 19960717).
   You must link the resulting object file with the libraries:
	-lf2c -lm   (in that order)
*/

#include "f2c.h"

/* Subroutine */ int nbinterp_(lratio, strip, strip_lo__, strip_hi__)
integer *lratio;
doublereal *strip;
integer *strip_lo__, *strip_hi__;
{
    /* System generated locals */
    integer strip_dim1, strip_dim2, strip_offset;

    /* Parameter adjustments */
    --lratio;
    strip_dim1 = *strip_hi__ - *strip_lo__ + 1;
    strip_dim2 = lratio[2] + 1;
    strip_offset = *strip_lo__;
    strip -= strip_offset;

    /* Function Body */
    return 0;
} /* nbinterp_ */
-------------------------------------------------------------

Best regards,
Alexander Samoilov



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