[Patch, fortran] PR16206 - array initializers

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Jun 19 20:14:00 GMT 2006


On Sun, Jun 18, 2006 at 02:31:38PM +0200, Paul Thomas wrote:
> 
> The attached responds to your questions/details.  It regtests on 
> FC5/Athlon.  Is it OK with the original testcase?
> 
> I realised a few minutes ago that the submitted version of the 
> transformational intrinsics patch was (i) not the final version in 
> simplify.c and (ii) was missing a small correction in 
> expr.c(simplify_parameter_variable).  This latter appears in the new 
> version of the PR16206 patch, and I have attached the correct version of 
> the simplify.c patch; sorry for that.
> 
> I'll wait for you to OK both before committing.
> 
> Many thanks, especially for picking up the memory leaks.
> 

My last comment.  In the following section of code, do really
mean to fallthrough to AR_FULL in the switch?  If yes, then
the convention is to add a comment as I've shown below.  
AFAICT, the patch is OK (with the fallthrough comment).

+           case AR_SECTION:
+             if (find_array_section (p, p->ref) == FAILURE)
+               return FAILURE;
+             p->ref->u.ar.type = AR_FULL;
+             /* FALLTHROUGH.  */

            case AR_FULL:
!             if (p->ref->next != NULL
!                   && (p->ts.type == BT_CHARACTER || p->ts.type == BT_DERIVED))
                {
!                 cons = p->value.constructor;
!                 for (; cons; cons = cons->next)
!                   {
!                     cons->expr->ref = copy_ref (p->ref->next);
!                     simplify_const_ref (cons->expr);
!                   }
                }
!             gfc_free_ref_list (p->ref);
!             p->ref = NULL;
              break;




-- 
Steve



More information about the Gcc-patches mailing list