Bug 25951 - [4.1/4.2 Regression] Problem with LOC intrinsic for assumed size arrays
Summary: [4.1/4.2 Regression] Problem with LOC intrinsic for assumed size arrays
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.0
: P5 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2006-01-24 23:11 UTC by Mark Hesselink
Modified: 2006-01-29 16:21 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-24 23:34:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hesselink 2006-01-24 23:11:28 UTC
Compiling the following code results in a compile error:

PROGRAM loc_1
CONTAINS
   SUBROUTINE f (x)
      INTEGER, DIMENSION(*)   :: x
      INTEGER                 :: address
      address=LOC(x)
   END SUBROUTINE f
END PROGRAM loc_1

The error produced by gfortran is:

[aardschokker:fms/trunk/obj] mark% /usr/local/bin/gfortran -c loc_1.f90
 In file loc_1.f90:6

      address=LOC(x)
                 1
Error: The upper bound in the last dimension must appear in the reference to the assumed size array 'x' at (1)

This code has been compiled with

[aardschokker:fms/trunk/obj] mark% /usr/local/bin/gfortran -v
Using built-in specs.
Target: powerpc-apple-darwin7.9.0
Configured with: /storage/usr/src/gcc/configure --prefix=/usr/local --disable-libmudflap --enable-altivec --enable-languages=c,fortran --with-gmp=/sw --with-mpfr=/sw
Thread model: posix
gcc version 4.2.0 20060121 (experimental)
Comment 1 Andrew Pinski 2006-01-24 23:34:56 UTC
Confirmed.
Comment 2 Mark Mitchell 2006-01-25 06:46:24 UTC
Fortran is not release-critical.
Comment 3 Paul Thomas 2006-01-29 16:21:29 UTC
Fixed on 4.2 and 4.1

Note the typo in the ChangeLog

2005-01-27  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/25964  !!!!!!!!!!
	* resolve.c (resolve_function): Add GFC_ISYM_LOC to the list of
	generic_ids exempted from assumed size checking.

As soon as I have a moment, I will correct this and a couple of other mis-identifications.

Paul