This is the mail archive of the gcc-patches@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]

Re: [gfortran] Fix PR 19479: Simplification of the {L|U}BOUND intrinsics


On Sun, Feb 27, 2005 at 02:51:38PM +0100, Tobias Schl?ter wrote:
> 
> This patch fixes the simplification of the UBOUND and LBOUND intrinsics.
> Previously they would get confused if there were component references in the
> reference chain.  The attached testcase segfaults before the patch and passes
> afterwards.
> 
> Bubblestrapped and tested on i686-pc-linux.  This patch is ported from g95,
> but I simplified the logic and chose non-obfuscated variable names.  Ok for
> mainline and the branch?
> 
> - Tobi
> 
> 2005-02-27  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
> 	(port from g95)
> 
> 	PR fortran/19479
> 	* simplify.c (gfc_simplify_bound): Overhaul.
> 

I've looked over this patch and I've bubblestrap/regtested on
amd64-*-freebsd6.0.  This OK to commit, once you check possible
whitespace problems.

  
>From your patch:

--- 1785,1841 ----
  
    /* Follow any component references.  */
   as = array->symtree->n.sym->as;
   for (ref = array->ref; ref; ref = ref->next)
     switch (ref->type)
       {
       case REF_ARRAY:
 	switch (ref->u.ar.type)
 	  {
 	  case AR_ELEMENT:
 	    as = NULL;
 	    continue;
 
 	  case AR_FULL:
 	    /* We're done because 'as' has already been set in the
 	       previous iteration.  */
 	    goto done;
 	    
 	  case AR_SECTION:
 	  case AR_UNKNOWN:
 	    return NULL;
 	  }
 
 	gcc_unreachable ();
 
       case REF_COMPONENT:
 	as = ref->u.c.component->as;
 	continue;
 
       case REF_SUBSTRING:
 	continue;
       }

The above appears to have whitespace problems.  Yes, I 
looked at the attached patch outside of my mail agent,
so tabs were preserved and set to 8 space.


-- 
Steve


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