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] Equivalence constraints and private types -redux


Paul Thomas wrote:
> OK for mainline and 4.03, when open?

Almost ok, except ...

> --- 2638,2656 ----
>   		goto cleanup;
>   	      }
>   
> ! 	  sym = set->expr->symtree->n.sym;
> ! 
> ! 	  if (gfc_add_in_equivalence (&sym->attr, sym->name, NULL)
> ! 		== FAILURE)
> ! 	    goto cleanup;
> ! 
> ! 	  if (sym->attr.in_common)
>   	    {
>   	      common_flag = TRUE;
> ! 	      common_head = sym->common_head;
>   	    }
>   
> ! 	  sym->attr.in_equivalence = 1;

the last line is redundant.

> + /* Returns the type of a symbol or sequence.  BT_INTEGER for numeric,
> +    BT_CHARACTER for characters and BT_UNKNOWN for mixed sequences.  */
> + 
> + static bt
> + sequence_type (gfc_typespec ts)


> !       if (previous_equiv_type == BT_INTEGER)
> ! 	{
> ! 	  if (equiv_type != BT_INTEGER)
> ! 	    {
> ! 	      if (gfc_notify_std (GFC_STD_GNU,
> ! 				  "Non-numeric object '%s' in numeric "
> ! 				  "EQUIVALENCE statement at %L",
> ! 				  sym->name, &e->where) == FAILURE)
> ! 		continue;
> ! 	    }
> ! 	}

This doesn't catch all incorrect cases:
 equivalence (i,x) ! <- allowed
 integer*8 j
 equivalence (j,y) ! <- not allowed

I'm also not too fond of overloading the meaning of the BT_*.  A new enum can
be used to solve both these issues at the same time.

- Tobi


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