+2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/50892
+ * trans-expr.c (gfc_trans_pointer_assignment): fold_convert rhs to
+ lhs type.
+
2018-01-05 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/78534
if (expr1->ts.deferred)
{
if (expr2->expr_type != EXPR_NULL && lse.string_length != NULL)
- gfc_add_modify (&block, lse.string_length, rse.string_length);
+ gfc_add_modify (&block, lse.string_length,
+ fold_convert (TREE_TYPE (lse.string_length),
+ rse.string_length));
else if (lse.string_length != NULL)
gfc_add_modify (&block, lse.string_length,
build_zero_cst (TREE_TYPE (lse.string_length)));
+2018-01-06 Janne Blomqvist <jb@gcc.gnu.org>
+
+ PR fortran/50892
+ * gfortran.dg/char_pointer_assign_icb_1.f90: New test.
+
2018-01-06 Jakub Jelinek <jakub@redhat.com>
PR debug/83480
--- /dev/null
+! { dg-do compile }
+! Reduced testcase from PR 50892, regressed due to r256284 (PR 78534)
+subroutine test
+ use, intrinsic :: ISO_C_Binding, only: c_ptr
+ type(c_ptr) :: text
+ character(len=:), pointer :: ftext
+ ftext => FortranChar(text)
+contains
+ function FortranChar ( C )
+ type(c_ptr), intent(in), value :: C
+ character(len=10), pointer :: FortranChar
+ end function FortranChar
+end subroutine test