2007-10-18 Paul Thomas <pault@gcc.gnu.org>
Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/33733
* simplify.c (gfc_simplify_transfer): Return null if the source
expression is EXPR_FUNCTION.
2007-10-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/33733
* gfortran.dg/transfer_simplify_6.f90: New test.
From-SVN: r129435
|| !gfc_is_constant_expr (size))
return NULL;
+ if (source->expr_type == EXPR_FUNCTION)
+ return NULL;
+
/* Calculate the size of the source. */
if (source->expr_type == EXPR_ARRAY
&& gfc_array_size (source, &tmp) == FAILURE)
--- /dev/null
+! { dg-do compile }
+! Checks the fix for PR33733, in which the functions of arrays
+! for the 'source' argument would cause an ICE.
+!
+! Contributed by FX Coudert <fxcoudert@gcc.gnu.org>
+!
+ print *, transfer(sqrt([100.]), 0_1)
+ print *, transfer(achar([100]), 0_1)
+end