Commit b14a13fa by Paul Thomas

re PR fortran/83901 (ICE in fold_convert_loc, at fold-const.c:2402)

2018-02-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83901
	* trans-stmt.c (trans_associate_var): Make sure that the se
	expression is a pointer type before converting it to the symbol
	backend_decl type.

2018-02-28  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/83901
	* gfortran.dg/associate_37.f90: New test.

	PR fortran/83344
	* gfortran.dg/associate_36.f90: Add Steve Kargl as contributer.

From-SVN: r258076
parent ba64c7b8
2018-02-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83901
* trans-stmt.c (trans_associate_var): Make sure that the se
expression is a pointer type before converting it to the symbol
backend_decl type.
2018-02-25 Steven G. Kargl <kargl@gcc.gnu.org> 2018-02-25 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/83633 PR fortran/83633
......
...@@ -1907,7 +1907,8 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block) ...@@ -1907,7 +1907,8 @@ trans_associate_var (gfc_symbol *sym, gfc_wrapped_block *block)
attr = gfc_expr_attr (e); attr = gfc_expr_attr (e);
if (sym->ts.type == BT_CHARACTER && e->ts.type == BT_CHARACTER if (sym->ts.type == BT_CHARACTER && e->ts.type == BT_CHARACTER
&& (attr.allocatable || attr.pointer || attr.dummy)) && (attr.allocatable || attr.pointer || attr.dummy)
&& POINTER_TYPE_P (TREE_TYPE (se.expr)))
{ {
/* These are pointer types already. */ /* These are pointer types already. */
tmp = fold_convert (TREE_TYPE (sym->backend_decl), se.expr); tmp = fold_convert (TREE_TYPE (sym->backend_decl), se.expr);
......
2018-02-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/83901
* gfortran.dg/associate_37.f90: New test.
PR fortran/83344
* gfortran.dg/associate_36.f90: Add Steve Kargl as contributer.
2018-02-28 Jakub Jelinek <jakub@redhat.com> 2018-02-28 Jakub Jelinek <jakub@redhat.com>
PR target/52991 PR target/52991
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
! !
! Test the fix for PR83344. ! Test the fix for PR83344.
! !
! Contributed by <Janne Blomqvist <jb@gcc.gnu.org> ! Contributed by Janne Blomqvist <jb@gcc.gnu.org>
! and Steve Kargl <kargl@gcc.gnu.org>
! !
program foo program foo
implicit none implicit none
......
! { dg-do run }
! { dg-options "-fcoarray=single" }
!
! Tests the fix for the regression PR83901.
!
! Contributed by G Steinmetz <gscfq@t-online.de>
!
program p
character(8), allocatable :: x[:]
allocate (x[*])
x = 'abc'
associate (y => x)
if (y .ne. 'abc') stop 1
end associate
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