[Patch, fortran] PR35759 - WHERE with overlap with ELSEWHERE error

Paul Richard Thomas paul.richard.thomas@gmail.com
Mon Mar 31 00:05:00 GMT 2008


:ADDPATCH fortran:

gfc_trans_where_3 is selected for a simple WHERE/ELSEWHERE, with no
dependencies and a single assignment expression in each block.  This
is selected by the reporter's testscase.  As Tobias found in comment
#1 of the PR, gfc_trans_where is not compliant with the standard
because the ELSEWHERE assignment is evaluated in the same loop as the
WHERE assignment, rather than two loops.  The fix is self explanatory.

Bootstrapped and regtested on x86_ia64/FC8 - OK for trunk and 4.3?

Paul

2008-03-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35759
	* trans-stmt.c (gfc_trans_where_3): Separate the WHERE and the
	ELSEWHERE evaluations into two loops.
	(gfc_trans_where): If there is an ELSEWHERE assignment and the
	mask is not a variable, do not call gfc_trans_where_3.

2008-03-30  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35759
	* gfortran.dg/where_1.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 10333 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080331/f3bac2b8/attachment.bin>


More information about the Gcc-patches mailing list