Commit fe14572b by Steven G. Kargl

re PR fortran/78092 (ICE when calling SIZEOF on CLASS(*) entry)

2016-10-26  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/78092
	* trans-intrinsic.c (gfc_conv_intrinsic_sizeof):  Fix reference to an
	array element of type CLASS.

2016-10-26  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/78092
	* gfortran.dg/pr78092.f90: New test.

From-SVN: r241610
parent 145f2067
2016-10-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78092
* trans-intrinsic.c (gfc_conv_intrinsic_sizeof): Fix reference to an
array element of type CLASS.
2016-10-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/78108
......
......@@ -6708,7 +6708,9 @@ gfc_conv_intrinsic_sizeof (gfc_se *se, gfc_expr *expr)
TREE_OPERAND (argse.expr, 0), 0)))
|| GFC_DECL_CLASS (TREE_OPERAND (argse.expr, 0)))))
byte_size = gfc_class_vtab_size_get (TREE_OPERAND (argse.expr, 0));
else if (arg->rank > 0)
else if (arg->rank > 0
|| (arg->rank == 0
&& arg->ref && arg->ref->type == REF_COMPONENT))
/* The scalarizer added an additional temp. To get the class' vptr
one has to look at the original backend_decl. */
byte_size = gfc_class_vtab_size_get (
......
2016-10-26 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/78092
* gfortran.dg/pr78092.f90: New test.
2016-10-26 Kelvin Nilsen <kelvin@gcc.gnu.org>
PR target/78056
......
! { dg-do run }
program test_stuff
implicit none
integer :: ivar1(2,3), ivar2
ivar1 = 6
call poly_sizeof(ivar1, ivar2)
if (ivar2 /= 4) call abort
contains
subroutine poly_sizeof(arg1,arg2)
class(*), intent(in) :: arg1(:,:)
integer, intent(out) :: arg2
arg2 = sizeof(arg1(1,1))
end subroutine
end program test_stuff
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment