[Patch, fortran] [55..56/66] inline sum and product: Prevent regressions: Fix gfc_conv_elemental_dependencies.

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


gfc_conv_elemental_dependency had some ad-hoc fixes to replace one array by its
temporary in the scalarizer.
It was using a fake gfc_loopinfo struct so that gfc_trans_create_temp_array
doesn't overwrite the real one.  It was using fake array references and custom
delta calculation, so that scalarizer's partial offset calculation used the
right array index while accessing the temporary even if it believed it was
accessing the regular array.
Patch 56 removes those fixes, replaces the array gfc_ss struct with a new 
one for the temporary and calls gfc_set_delta to update arrays' delta after
calling gfc_trans_create_temp_array.
Patch 55 is a preliminary patch making some functions public.
OK?
-------------- next part --------------
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-array.h (gfc_free_ss, gfc_set_delta): New prototypes.
	* trans-array.c (gfc_free_ss): Remove forward declaration.
	Make non-static.
	(set_delta, gfc_set_delta): Remove forward declaration.
	Make non-static and rename the former to the later. Update uses.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43829-55.patch
Type: text/x-diff
Size: 3076 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111027/bd4b07e9/attachment.bin>
-------------- next part --------------
2011-10-19  Mikael Morin  <mikael@gcc.gnu.org>

	* trans-expr.c (gfc_conv_procedure_call): Handle temporaries for
	arguments to elemental calls.
	* trans-stmt.c (replace_ss): New function.
	(gfc_conv_elemental_dependencies): Remove temporary loop handling.
	Create a new ss for the temporary and replace the original one with it.
	Remove fake array references. Recalculate all offsets.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr43829-56.patch
Type: text/x-diff
Size: 6291 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20111027/bd4b07e9/attachment-0001.bin>


More information about the Fortran mailing list