This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR66089 fix elemental dependency mishandling
- From: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- To: Mikael Morin <mikael dot morin at sfr dot fr>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 3 Feb 2016 14:00:01 +0100
- Subject: Re: [Patch, fortran] PR66089 fix elemental dependency mishandling
- Authentication-results: sourceware.org; auth=none
- References: <56AFD723 dot 2050709 at sfr dot fr>
Dear Mikael,
The patch is OK for trunk.
A small niggle: Although present in the original testcase, 'a' is unused.
I am not in a position to find out for myself, right now, but does the
testcase of comment #10 work with this patch?
Thanks for the patch
Paul
On 1 February 2016 at 23:07, Mikael Morin <mikael.morin@sfr.fr> wrote:
> Hello,
>
> this is about the case
>
> c(:) = elemental_func(c(1), ...)
>
> where as a result of a trunk change, only a reference to c(1) is saved to a
> temporary variable, instead of its value.
>
> The fix tries to save the amount of copying as much as possible by detecting
> the above case. Technically through the usage of a new field
> needs_temporary.
>
> The patch is a variant of the one that has been on bugzilla for months.
> The main difference is the usage of gfc_expr_is_variable instead of the
> check for expr_type == EXPR_VARIABLE (the former includes pointer-returning
> functions as well).
>
> Regression-tested on x86_64-unknown-linux-gnu. OK for trunk?
> Mikael
>
--
The difference between genius and stupidity is; genius has its limits.
Albert Einstein