re PR fortran/17740 (ICE in gfc_trans_arrayfunc_assign, at fortran/trans-expr.c:2011)

2005-09-13  Erik Edelmann  <erik.edelmann@iki.fi>
fortran/
	PR fortran/17740
	* trans-expr.c (gfc_trans_arrayfunc_assign): Check value
	of attr.elemental for specific function instead of generic name.
testsuite/
	PR fortran/17740
	* gfortran.dg/generic_4.f90: New test.

From-SVN: r104240
This commit is contained in:
Erik Edelmann 2005-09-14 00:46:04 +03:00 committed by Tobias Schlüter
parent 282c3fdc47
commit c4abe01049
4 changed files with 41 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2005-09-13 Erik Edelmann <erik.edelmann@iki.fi>
PR fortran/17740
* trans-expr.c (gfc_trans_arrayfunc_assign): Check value
of attr.elemental for specific function instead of generic name.
2005-09-13 Richard Sandiford <richard@codesourcery.com>
PR fortran/18899

View File

@ -2573,7 +2573,8 @@ gfc_trans_arrayfunc_assign (gfc_expr * expr1, gfc_expr * expr2)
return NULL;
/* Elemental functions don't need a temporary anyway. */
if (expr2->symtree->n.sym->attr.elemental)
if (expr2->value.function.esym != NULL
&& expr2->value.function.esym->attr.elemental)
return NULL;
/* Fail if EXPR1 can't be expressed as a descriptor. */

View File

@ -1,3 +1,8 @@
2005-09-13 Erik Edelmann <erik.edelmann@iki.fi>
PR fortran/17740
* gfortran.dg/generic_4.f90: New test.
2005-09-13 Bastian Blank <waldi@debian.org>
PR c++/16171

View File

@ -0,0 +1,28 @@
! { dg-do run }
! reduced testcase from PR 17740
module FOO
interface BAR
module procedure BAR2
end interface
contains
elemental integer function BAR2(X)
integer, intent(in) :: X
BAR2 = X
end function
subroutine BAZ(y,z)
integer :: Y(3), Z(3)
Z = BAR(Y)
end subroutine
end module
use foo
integer :: y(3), z(3)
y = (/1,2,3/)
call baz(y,z)
if (any (y /= z)) call abort ()
end