]> gcc.gnu.org Git - gcc.git/commit
fortran: Move the clobber generation code
authorMikael Morin <mikael@gcc.gnu.org>
Wed, 31 Aug 2022 09:00:45 +0000 (11:00 +0200)
committerMikael Morin <mikael@gcc.gnu.org>
Wed, 12 Oct 2022 11:32:12 +0000 (13:32 +0200)
commit0172c0685e94e884d4da35a37b92bbbee6bc1ee9
tree2cdb0101ba4d3ca6db3fb4109bb6dbcc2ae49cf2
parent3cea0a0e39eebaf8cb9590785a2ce53cbd69e415
fortran: Move the clobber generation code

This change inlines the clobber generation code from
gfc_conv_expr_reference to the single caller from where the add_clobber
flag can be true, and removes the add_clobber argument.

What motivates this is the standard making the procedure call a cause
for a variable to become undefined, which translates to a clobber
generation, so clobber generation should be closely related to procedure
call generation, whereas it is rather orthogonal to variable reference
generation.  Thus the generation of the clobber feels more appropriate
in gfc_conv_procedure_call than in gfc_conv_expr_reference.

Behaviour remains unchanged.

gcc/fortran/ChangeLog:

* trans.h (gfc_conv_expr_reference): Remove add_clobber
argument.
* trans-expr.cc (gfc_conv_expr_reference): Ditto. Inline code
depending on add_clobber and conditions controlling it ...
(gfc_conv_procedure_call): ... to here.

(cherry picked from commit 2b393f6f83903cb836676bbd042c1b99a6e7e6f7)
gcc/fortran/trans-expr.cc
gcc/fortran/trans.h
This page took 0.061175 seconds and 6 git commands to generate.