[Patch, fortran] PR43841 and PR43843 - Missing temporary for ELEMENTAL function call

Paul Richard Thomas paul.richard.thomas@gmail.com
Fri Apr 23 07:45:00 GMT 2010

This one can only be described as embarrassing!  GFC_SS_REFERENCEs
were being stored as a temporary but not by value.  Thus dependencies
like the one in the testcase were not correctly handled.  I decided to
keep GFC_SS_REFERENCE, rather than convert to GFC_SS_SCALAR, so that
the mechanism for elemental procedure arguments does not get messed up
by the special cases of the latter (WHERE blocks or indices).  It is
probably over prissy but it does not cost any more than an extra enum

The testcase is the reporter's original, rather than Harald's
reduction; just to ensure that all variants of array normalisation to
a member work correctly.

Many thanks to Kyle for the report!

Bootstrapped and regtested on FC9/x86_64 - OK for trunk, 4.5, 4.4, & ...?



2010-04-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/43841
	PR fortran/43843
	* trans-expr.c (gfc_conv_expr): Supply an address expression for
	(gfc_conv_expr_reference): Call gfc_conv_expr and return for
	* trans-array.c (gfc_add_loop_ss_code): Store the value rather
	than the address of a GFC_SS_REFERENCE.
	* trans.h : Change comment on GFC_SS_REFERENCE.

2010-04-23  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/43841
	PR fortran/43843
	* gfortran.dg/elemental_scalar_args_1.f90 : New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-diff
Size: 5686 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100423/6e3a5506/attachment.bin>

More information about the Gcc-patches mailing list