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] PR24227 initialized symbol in COMMON: Missing checks


Jerry DeLisle wrote:
> This patch adds back a simplified error message and checks to see if
> the symbol is in BLOCK DATA or not.  Allowed if -std=gnu.
> Regression tested on x86-64.
> OK for trunk?

+	  if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE) 
+	    goto cleanup;
[...]
+
 	  if (gfc_add_in_common (&sym->attr, sym->name, NULL) == FAILURE)
 	    goto cleanup;


Adding in_common twice looks wrong.


Additionally, the following variant using DATA compiles without giving
an error:

program main
 implicit none
 integer, parameter:: nmin = 2
 character(len=3) :: emname(nmin)
 data emname/'bar','baz'/
 common/dd/emname ! { dg-error "can only be COMMON in BLOCK DATA" }
end program main

Tobias


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