[patch, fortran] PR24227 initialized symbol in COMMON: Missing checks

Jerry DeLisle jvdelisle@verizon.net
Tue Nov 27 07:45:00 GMT 2007


Jerry DeLisle wrote:
> Tobias Burnus wrote:
>> 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;
>>
>>
> 
> The double statement above was there before.  I thought it was odd also, 
> but put it back the way it was before.  I will take it out and test.
> 
>> 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
>>
> I will have a look later this evening.
> 

Attached is a revised patch.  Regression tested on x86-64.  I also compiled all 
of the Polyhedron test cases, NIST, and LAPACK.

OK for trunk?

Jerry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr34227-2.diff
Type: text/x-patch
Size: 651 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071127/c69ddfbb/attachment.bin>


More information about the Fortran mailing list