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]

[patch, fortran] PR32361 TYPE DECLARATION TO INITIALIZE DATA IN NAMED COMMON


This patch is simple, allowing the NULL to be used.

Regression tested on x86-64.

OK for trunk? Test case will be added.

Does this need to be an extension similar to my question on pr32360?

Reporters example case:

      BLOCK DATA
       integer, pointer :: ptr1 => NULL()
       common / T / ptr1
      END

Jerry

2007-06-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>

	PR fortran/32361
	* match.c (gfc_match_common): If the symbol value expression type is
	NULL_EXPR, don't error if previously initialized to null.
Index: match.c
===================================================================
*** match.c	(revision 125747)
--- match.c	(working copy)
*************** gfc_match_common (void)
*** 2417,2423 ****
  	  if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE) 
  	    goto cleanup;
  
! 	  if (sym->value != NULL
  	      && (name[0] == '\0' || !sym->attr.data))
  	    {
  	      if (name[0] == '\0')
--- 2417,2423 ----
  	  if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE) 
  	    goto cleanup;
  
! 	  if (sym->value != NULL && sym->value->expr_type != EXPR_NULL
  	      && (name[0] == '\0' || !sym->attr.data))
  	    {
  	      if (name[0] == '\0')

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