This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] Fix PR 17283: PACK intrinsic not working
- From: Paul Brook <paul at codesourcery dot com>
- To: fortran at gcc dot gnu dot org
- Cc: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 3 Oct 2004 15:19:29 +0100
- Subject: Re: [gfortran] Fix PR 17283: PACK intrinsic not working
- Organization: CodeSourcery
- References: <4150A61B.5090103@physik.uni-muenchen.de>
> 2004-09-21 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
>
> PR fortran/17283
> fortran/
> * iresolve.c (gfc_resolve_pack): Choose function depending if mask is
> scalar.
> libgfortran/
> * intrinsics/pack_generic.c (__pack): Allocate memory for return array
> if not done by caller.
> (__pack_s): New function.
> * runtime/memory.c (internal_malloc, internal_malloc64): Allow
> allocating zero memory.
> testsuite/
> * gfortran.fortran-torture/execute/intrinsic_pack.f90: Add more tests.
This doesn't work when the scalar mask has kind!=4.
As the mask is intent(in), you could be able do the conversion in the
resolution function.
In the array mask case we play tricks in the library to handle this without
requiring a copy.
Paul