From: Jerry DeLisle Date: Fri, 8 Jul 2016 04:36:16 +0000 (+0000) Subject: re PR fortran/71764 (ICE in gfc_trans_structure_assign) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70cdd4ae94a5db49774b64881e93b6c58ecc5574;p=gcc.git re PR fortran/71764 (ICE in gfc_trans_structure_assign) 2016-07-07 Jerry DeLisle PR fortran/71764 * trans-expr.c (gfc_trans_structure_assign): Remove assert. * gfortran.dg/pr71764.f90: New test. From-SVN: r238156 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f4d84e85557..afd9f061baa 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-07-07 Jerry DeLisle + + PR fortran/71764 + * trans-expr.c (gfc_trans_structure_assign): Remove assert. + 2016-07-07 Martin Liska * lang.opt (Wundefined-do-loop): New option. diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index b5731aa8bbe..4321850b59d 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -7358,7 +7358,6 @@ gfc_trans_structure_assign (tree dest, gfc_expr * expr, bool init) { gfc_se se, lse; - gcc_assert (cm->backend_decl == NULL); gfc_init_se (&se, NULL); gfc_init_se (&lse, NULL); gfc_conv_expr (&se, gfc_constructor_first (expr->value.constructor)->expr); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c61e6e5a201..22a4a588803 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-07-07 Jerry DeLisle + + PR fortran/71764 + * gfortran.dg/pr71764.f90: New test. + 2016-07-07 Jakub Jelinek Kai Tietz diff --git a/gcc/testsuite/gfortran.dg/pr71764.f90 b/gcc/testsuite/gfortran.dg/pr71764.f90 new file mode 100644 index 00000000000..48176f8297e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr71764.f90 @@ -0,0 +1,34 @@ +! { dg-do run } +! PR71764 +program p + use iso_c_binding, only: c_ptr, c_null_ptr, c_ptr, c_associated, c_loc + logical, target :: rls + real, target :: t = 3.14 + type(c_ptr) :: nullptr,c + real, pointer :: k + nullptr = c_null_ptr + c = nullptr + rls = c_associated(c) + if (rls) call abort + if (c_associated(c)) call abort + c = c_loc(rls) + if (.not. c_associated(c)) call abort + c = nullptr + if (c_associated(c)) call abort + c = c_loc(t) + k => t + call association_test(k, c) +contains + subroutine association_test(a,b) + use iso_c_binding, only: c_associated, c_loc, c_ptr + implicit none + real, pointer :: a + type(c_ptr) :: b + if(c_associated(b, c_loc(a))) then + return + else + call abort + end if + end subroutine association_test +end +