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: [Patch, fortran] PR47592 - Multiple function invocation with ALLOCATE (SOURCE=REPEAT('x',bar()))


Am 06.02.2011 10:59, Paul Richard Thomas wrote:
Note that I have removed the calls of gfc_start_block and replaced
them with gfc_init_block, since the former does all sorts of strange
things with declarations as the warning in trans.c indicates.

I think there are several places in gfortran where an init_block would be better than a start_block.


Bootstraps and regtests on FC9/x86_64 - OK for trunk?

OK, though you could consider shortening the code as indicated below. Thanks for the patch!


+
! 	  ref = expr->ref;
! 	  /* Find the last reference in the chain.  */
! 	  while (ref&&  ref->next != NULL)
! 	    {
! 	      gcc_assert (ref->type != REF_ARRAY || ref->u.ar.type == AR_ELEMENT);
! 	      ref = ref->next;
! 	    }
! 	  if (!ref)
! 	    allocatable = expr->symtree->n.sym->attr.allocatable;
! 	  else
! 	    allocatable = ref->u.c.component->attr.allocatable;
!
! 	  if (allocatable)


That's mostly unchanged from previous version, but couldn't one replace it by a simple "if (gfc_expr_attr (expr).allocatable)"? I think gfc_expr_attr does not always do the right thing (regarding when to ignore and not ignore array/substring refs), but I think here it does.


Tobias


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