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

2009-01-19 Thread mikael at gcc dot gnu dot org


--- Comment #6 from mikael at gcc dot gnu dot org  2009-01-19 22:19 ---
Subject: Bug 38859

Author: mikael
Date: Mon Jan 19 22:19:34 2009
New Revision: 143501

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143501
Log:
2009-01-19  Mikael Morin  

PR fortran/38859
* simplify.c (simplify_bound): Don't use array specification
if variable or component has subsequent references.

2009-01-19  Mikael Morin  

PR fortran/38859
* gfortran.dg/bound_5.f90: New test.


Added:
trunk/gcc/testsuite/gfortran.dg/bound_5.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/simplify.c
trunk/gcc/testsuite/ChangeLog


-- 


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



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

2009-01-17 Thread burnus at gcc dot gnu dot org


--- Comment #5 from burnus at gcc dot gnu dot org  2009-01-17 15:45 ---
> shouldn't this be fixed for 4.3.3?
Too late - the release is too soon (freeze; release-candidate build is
running). Regarding 4.4.0: Do you plan to submit a patch soonish?


-- 


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



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

2009-01-17 Thread mikael at gcc dot gnu dot org


--- Comment #4 from mikael at gcc dot gnu dot org  2009-01-17 14:59 ---
shouldn't this be fixed for 4.3.3?


-- 


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



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

2009-01-15 Thread mikael at gcc dot gnu dot org


--- Comment #3 from mikael at gcc dot gnu dot org  2009-01-15 21:30 ---
quick fix:

Index: simplify.c
===
--- simplify.c  (révision 143354)
+++ simplify.c  (copie de travail)
@@ -2253,7 +2253,8 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gf
case AR_FULL:
  /* We're done because 'as' has already been set in the
 previous iteration.  */
- goto done;
+ if (!ref->next)
+   goto done;

case AR_SECTION:
case AR_UNKNOWN:


-- 


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



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

2009-01-15 Thread burnus at gcc dot gnu dot org


--- 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



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

2009-01-15 Thread burnus at gcc dot gnu dot org


--- Comment #1 from burnus at gcc dot gnu dot org  2009-01-15 20:04 ---
Confirm. This is a regression with regards to 4.2.1; it fails at least since
20071008 (my oldest 4.3 trunk version).

Thanks for the report!


-- 

burnus at gcc dot gnu dot org changed:

   What|Removed |Added

OtherBugsDependingO||32834
  nThis||
 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Keywords||wrong-code
  Known to fail||4.3.0 4.3.2 4.4.0
  Known to work||4.2.1 4.1.3
   Priority|P3  |P4
   Last reconfirmed|-00-00 00:00:00 |2009-01-15 20:04:20
   date||
Summary|ubound and lbound treat |[4.3/4.4 Regression] ubound
   |structure component |and lbound treat structure
   |references as whole arrays  |component references as
   ||whole arrays
   Target Milestone|--- |4.3.4


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