[Patch, fortran] [11/66] inline sum and product: Preliminary cleanups: Skip temporary case.

Mikael Morin mikael.morin@sfr.fr
Thu Oct 27 23:36:00 GMT 2011


We can't use temporaries to guess loop dimensions, as temporaries' bounds are
calculated from loop dimensions. 

In the union:
union
{                           
  struct { ... } scalar;                         
  struct { ... } temp;
  struct gfc_ss_info info
}                           
data;

We are currently accessing data.struct.info even in the GFC_SS_TEMP case where
it is not defined. However, the aliasing and the code interact in such a way
that the temporary is never chosen to get loop bounds; so it works.

This patch prevents accessing gfc_ss::data::info in cases it has invalid
content, so that we can update gfc_ss_info without caring about aliasing
problems.
OK?
-------------- next part --------------
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.c (gfc_conv_loop_setup): Also skip temporary arrays.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43829-11.patch
Type: text/x-diff
Size: 607 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20111027/e120dc32/attachment.bin>


More information about the Gcc-patches mailing list