Commit 4ca4d1e9 by Andre Vehreschild

re PR fortran/79229 (ICE in gfc_trans_assignment_1 with -fcheck=mem)

gcc/testsuite/ChangeLog:

2017-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79229
	* gfortran.dg/class_allocate_24.f90: New test.


gcc/fortran/ChangeLog:

2017-02-19  Andre Vehreschild  <vehre@gcc.gnu.org>

	PR fortran/79229
	* trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when
	compiling with -fcheck=mem to check the pointer and not the data.

From-SVN: r245581
parent dea71ad0
......@@ -7,6 +7,12 @@
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/79229
* trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when
compiling with -fcheck=mem to check the pointer and not the data.
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/79335
* trans-array.c (duplicate_allocatable_coarray): Ensure attributes
passed are properly initialized.
......
......@@ -9961,13 +9961,16 @@ gfc_trans_assignment_1 (gfc_expr * expr1, gfc_expr * expr2, bool init_flag,
tree cond;
const char* msg;
tmp = INDIRECT_REF_P (lse.expr)
? gfc_build_addr_expr (NULL_TREE, lse.expr) : lse.expr;
/* We should only get array references here. */
gcc_assert (TREE_CODE (lse.expr) == POINTER_PLUS_EXPR
|| TREE_CODE (lse.expr) == ARRAY_REF);
gcc_assert (TREE_CODE (tmp) == POINTER_PLUS_EXPR
|| TREE_CODE (tmp) == ARRAY_REF);
/* 'tmp' is either the pointer to the array(POINTER_PLUS_EXPR)
or the array itself(ARRAY_REF). */
tmp = TREE_OPERAND (lse.expr, 0);
tmp = TREE_OPERAND (tmp, 0);
/* Provide the address of the array. */
if (TREE_CODE (lse.expr) == ARRAY_REF)
......
2017-02-19 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/79229
* gfortran.dg/class_allocate_24.f90: New test.
2017-02-19 Paul Thomas <pault@gcc.gnu.org>
PR fortran/79402
......
! { dg-do compile }
! { dg-options "-fcheck=mem" }
!
! Compile time check only, to test that the ICE is fixed in the assignment of the
! default initializer of the class to sf.
implicit none
type :: t
integer, pointer :: data => null ()
end type
class(t), dimension(:), allocatable :: sf
allocate (t :: sf (1))
end
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