This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, fortran] PR22146 - ICE on elemental subroutine calls with array-valued actual arguments
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: patch <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Thu, 05 Jan 2006 23:07:54 +0100
- Subject: Re: [Patch, fortran] PR22146 - ICE on elemental subroutine calls with array-valued actual arguments
- References: <43BA9061.1000003@wanadoo.fr> <43BC44CC.6010502@wanadoo.fr>
Paul Thomas wrote:
> The line "call foobar (cos (x) + u, y)" in the first test case produces:
>
> {
> int4 S.12;
>
> S.12 = 1;
> while (1)
> {
> if (S.12 > 2) goto L.10; else (void) 0;
> {
> real4 D.861;
>
> D.861 = __builtin_cosf (x[NON_LVALUE_EXPR <S.12> + -1]) + D.859;
> foobar (&D.861, &y[NON_LVALUE_EXPR <S.12> + -1]);
> }
> S.12 = S.12 + 1;
> }
> L.10:;
> }
>
> which seems to be entirely as it ought to be.
Beautiful.
> OK for trunk and 4.1?
Yes, except for the issues I point out below.
> --- 49,60 ----
> /* Generate scalarization information for an expression. */
> gfc_ss *gfc_walk_expr (gfc_expr *);
> /* Walk the arguments of an intrinsic function. */
> ! gfc_ss *gfc_walk_elemental_function_args (gfc_ss *, gfc_actual_arglist *, gfc_ss_type);
Please fix the comment, while you're there.
> +
> + /* An elemental subroutine call with array valued arguments has
> + to be scalarized. */
> else
> ! {
At the risk of looking creative in inventing problems, I'd prefer if the
comment be inside the curly braces, so that the if ... else ... clearly visible.
> ! gfc_loopinfo loop;
> ! stmtblock_t body;
> ! stmtblock_t block;
> ! gfc_se loopse;
> !
> ! /* gfc_walk_elemental_function_args renders the ss chain in the
> ! reverse order to the actual argument order. */
> ! ss = gfc_reverse_ss (ss);
How is this achieved in the case of functions? I didn't see any such magic in
that case, and I verified that the argument chains are worked off in the right
order.
- Tobi
:REVIEWMAIL: