This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR35759 - WHERE with overlap with ELSEWHERE error
- From: "Paul Richard Thomas" <paul dot richard dot thomas at gmail dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Fortran List" <fortran at gcc dot gnu dot org>, "Dominique Dhumieres" <dominiq at lps dot ens dot fr>
- Date: Mon, 31 Mar 2008 13:30:57 +0200
- Subject: Re: [Patch, fortran] PR35759 - WHERE with overlap with ELSEWHERE error
- References: <339c37f20803301230g7bbe6d9bmc3484fae78539744@mail.gmail.com>
Dominique,
Thanks for pointing out that the patch fixes PR35756 as well - I
should have seen that. I will extend the testcase, regtest once more
and commit tonight.
Cheers
Paul
PS Memo to self - ensure that allocatable components do not leak for
this patch, at least:) I'll post what I finally commit.
On Sun, Mar 30, 2008 at 9:30 PM, Paul Richard Thomas
<paul.richard.thomas@gmail.com> wrote:
> :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.
>
--
The knack of flying is learning how to throw yourself at the ground and miss.
--Hitchhikers Guide to the Galaxy