[Patch, fortran] [20/21] Remove coarray support in the scalarizer: Remove coarray argument

Mikael Morin mikael.morin@sfr.fr
Thu Sep 15 23:10:00 GMT 2011


This patch, like the previous one, removes one argument from
gfc_conv_section_startstride.
We have to be more careful here as the two callers use different values
for the flag.
gfc_conv_ss_startstride calls gfc_conv_section_startstride with coarray=false.
Thus removing every !coarray condition should not be worrying.

gfc_conv_expr_descriptor on the other hand calls it with coarray=true; we have
to be more careful.

The first "if (!coarray)" is under an if (ar->dimen_type[dim] == DIMEN_VECTOR),
irrelevant for coarrays. We add an assertion that 
ar->dimen_type[dim] == DIMEN_THIS_IMAGE in gfc_conv_expr_descriptor and can
remove that condition.

The second one protects the stride initialization. As stride is
a local variable, we can remove that condition safely.
 
The third and four ones protect initialisation of info->stride[dim].
For codimensions, the stride is ignored, so we can remove that one two.
To make sure that we don't add unnecessary (and possibly costly) stride
evaluation code, that is the (stride == NULL) branch is taken, we add an
assertion in gfc_conv_expr_descriptor to check that ar->stride[dim] == NULL.
Then we can remove the flag.

OK?
-------------- next part --------------
2011-09-14  Mikael Morin  <mikael.morin@sfr.fr>

	* trans-array.c (gfc_conv_section_startstride): Remove coarray argument.
	Remove conditions on coarray.
	(gfc_conv_ss_startstride): Update call to gfc_conv_section_startstride.
	(gfc_conv_expr_descriptor): Ditto. Add assertions before the call.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: no_coarray_in_scalarizer-20.diff
Type: text/x-diff
Size: 2647 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20110915/c1905c71/attachment.bin>


More information about the Gcc-patches mailing list