+2007-05-25 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/32047
+ * trans-expr.c (gfc_apply_interface_mapping_to_expr): Change
+ order in logic under EXPR_FUNCTION to handle functions with
+ no arguments.
+
2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/31716
break;
case EXPR_FUNCTION:
- if (expr->value.function.actual->expr->expr_type == EXPR_VARIABLE
- && gfc_apply_interface_mapping_to_expr (mapping,
- expr->value.function.actual->expr)
- && expr->value.function.esym == NULL
+ if (expr->value.function.esym == NULL
&& expr->value.function.isym != NULL
- && expr->value.function.isym->generic_id == GFC_ISYM_LEN)
+ && expr->value.function.isym->generic_id == GFC_ISYM_LEN
+ && expr->value.function.actual->expr->expr_type == EXPR_VARIABLE
+ && gfc_apply_interface_mapping_to_expr (mapping,
+ expr->value.function.actual->expr))
{
gfc_expr *new_expr;
new_expr = gfc_copy_expr (expr->value.function.actual->expr->ts.cl->length);
+2007-05-25 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/32047
+ * gfortran.dg/result_in_spec_2.f90: New test.
+
2007-05-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-math-4.c: Fix dg-xfail-if.
--- /dev/null
+! { dg-do run }
+! Tests the fix for PR32047, in which the null agument
+! function for the character length would cause an ICE.
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org >
+!
+module test1
+ implicit none
+contains
+ character(f()) function test2() result(r)
+ interface
+ pure function f()
+ integer f
+ end function f
+ end interface
+ r = '123'
+ end function test2
+end module test1
+
+pure function f()
+ integer :: f
+ f = 3
+end function f
+
+program test
+ use test1
+ implicit none
+ if(len (test2()) /= 3) call abort ()
+ if(test2() /= '123') call abort ()
+end program test
+! { dg-final { cleanup-modules "test1" } }