[PATCH] Automatics in equivalence statements
Mon Jun 24 13:47:00 GMT 2019
On 24/06/2019 09:19, Bernhard Reutner-Fischer wrote:
> On Fri, 21 Jun 2019 07:10:11 -0700
> Steve Kargl <email@example.com> wrote:
>> On Fri, Jun 21, 2019 at 02:31:51PM +0100, Mark Eggleston wrote:
>>> Currently variables with the AUTOMATIC attribute can not appear in an
>>> EQUIVALENCE statement. However its counterpart, STATIC, can be used in
>>> an EQUIVALENCE statement.
>>> Where there is a clear conflict in the attributes of variables in an
>>> EQUIVALENCE statement an error message will be issued as is currently
>>> the case.
>>> If there is no conflict e.g. a variable with a AUTOMATIC attribute and a
>>> variable(s) without attributes all variables in the EQUIVALENCE will
>>> become AUTOMATIC.
>>> Note: most of this patch was written by Jeff Law <firstname.lastname@example.org>
>>> Please review.
>>> Â Â Â Jeff LawÂ <email@example.com>
>>> Â Â Â Mark EgglestonÂ <firstname.lastname@example.org>
>>> Â Â Â * gfortran.h: Add check_conflict declaration.
>> This is wrong. By convention a routine that is not static
>> has the gfc_ prefix.
> Furthermore doesn't this export indicate that you're committing a
> layering violation somehow?
Don't know what this means.
>> Â Â Â * symbol.c (check_conflict): Remove automatic in equivalence conflict
>> Â Â Â check.
>> Â Â Â * symbol.c (save_symbol): Add check for in equivalence to stop the
>> Â Â Â the save attribute being added.
>> Â Â Â * trans-common.c (build_equiv_decl): Add is_auto parameter and
>> Â Â Â add !is_auto to condition where TREE_STATIC (decl) is set.
>> Â Â Â * trans-common.c (build_equiv_decl): Add local variable is_auto,
>> Â Â Â set it true if an atomatic attribute is encountered in the variable
> atomatic? I read atomic but you mean automatic.
>> Â Â Â list.Â Call build_equiv_decl with is_auto as an additional parameter.
>> Â Â Â flag_dec_format_defaults is enabled.
>> Â Â Â * trans-common.c (accumulate_equivalence_attributes) : New subroutine.
>> Â Â Â * trans-common.c (find_equivalence) : New local variable dummy_symbol,
>> Â Â Â accumulated equivalence attributes from each symbol then check for
>> Â Â Â conflicts.
> I'm just curious why you don't gfc_copy_attr for the most part of accumulate_equivalence_attributes?
I didn't write the original of this patch, I made a minor change and
wrote the test cases. The main body of the work was done by Jeff LawÂ
<email@example.com>. I'll have a look at gfc_copy_attr to see if better
code can be used.
I have inherited the responsibility of getting this patch upstreamed,
any help in achieving this will be appreciated.
More information about the Gcc-patches