This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] PR 15327: Fix merge intrinsic for strings
- From: Paul Brook <paul at codesourcery dot com>
- To: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- Cc: fortran at gcc dot gnu dot org, patch <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 1 Sep 2004 23:43:50 +0100
- Subject: Re: [gfortran] PR 15327: Fix merge intrinsic for strings
- Organization: CodeSourcery
- References: <4132460D.20900@physik.uni-muenchen.de> <200409012236.14013.paul@codesourcery.com> <41364F1A.9020105@physik.uni-muenchen.de>
On Wednesday 01 September 2004 23:37, Tobias Schlüter wrote:
> Paul Brook wrote:
> > merge (a, b, flag) should expand to
> > _result = flag?a:b; _result_length = len(a)
> > ie. basically the same as the numeric case, but also setting the string
> > length.
>
> Done. Updated patch below. Yes, this is much better.
>
> Built and tested. OK?
>
> - Tobi
>
> 2004-09-01 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
>
> PR fortran/15327
> * trans-intrinsic.c (gfc_conv_intrinsic_merge): Do the right thing for
> strings.
Ok, except you might want to consider:
> ! type = TREE_TYPE (tsource);
> ! se->expr = fold (build3 (COND_EXPR, type, mask, tsource, fsource));
This is the same in both cases, so could be moved outside the if.
Paul