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]
Other format: [Raw text]

[Bug fortran/38859] [4.3/4.4 Regression] ubound and lbound treat structure component references as whole arrays



------- Comment #2 from burnus at gcc dot gnu dot org  2009-01-15 20:10 -------
       ida = lbound(a%i)
       if (any(ida /= (/1,1/))) print *, 'lbound    ', ida

Here, gfortran prints:
   lbound  0  2
Correct would be
   lbound  1  1


       ida = ubound(a)
>>>>>>>>>>>>>>>>>>>^^^
Here a "%i" is missing otherwise the following line does not make sense:

       if (any(ida /= (/6,7/))) print *, 'ubound    ', ida

For ubound(a) the result should be "5 8" which is also gfortran's result.
For ubound(a%i):
  gfortran: 5 8
  correct:  6 7


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38859


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