Commit 7651172f by Tobias Burnus

re PR fortran/58880 ([OOP] ICE on valid with FINAL function and type extension)

2014-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58880
        * trans-expr.c (gfc_conv_scalar_to_descriptor): Fix handling
        of nonpointers.

2014-03-27  Tobias Burnus  <burnus@net-b.de>

        PR fortran/58880
        * gfortran.dg/finalize_24.f90: New.

From-SVN: r208879
parent 117f16fb
2014-03-27 Tobias Burnus <burnus@net-b.de>
PR fortran/58880
* trans-expr.c (gfc_conv_scalar_to_descriptor): Fix handling
of nonpointers.
2014-03-26 Dominique d'Humieres <dominiq@lps.ens.fr> 2014-03-26 Dominique d'Humieres <dominiq@lps.ens.fr>
PR fortran/34928 PR fortran/34928
......
...@@ -69,14 +69,16 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar, symbol_attribute attr) ...@@ -69,14 +69,16 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar, symbol_attribute attr)
type = get_scalar_to_descriptor_type (scalar, attr); type = get_scalar_to_descriptor_type (scalar, attr);
desc = gfc_create_var (type, "desc"); desc = gfc_create_var (type, "desc");
DECL_ARTIFICIAL (desc) = 1; DECL_ARTIFICIAL (desc) = 1;
if (!POINTER_TYPE_P (TREE_TYPE (scalar)))
scalar = gfc_build_addr_expr (NULL_TREE, scalar);
gfc_add_modify (&se->pre, gfc_conv_descriptor_dtype (desc), gfc_add_modify (&se->pre, gfc_conv_descriptor_dtype (desc),
gfc_get_dtype (type)); gfc_get_dtype (type));
gfc_conv_descriptor_data_set (&se->pre, desc, scalar); gfc_conv_descriptor_data_set (&se->pre, desc, scalar);
/* Copy pointer address back - but only if it could have changed and /* Copy pointer address back - but only if it could have changed and
if the actual argument is a pointer and not, e.g., NULL(). */ if the actual argument is a pointer and not, e.g., NULL(). */
if ((attr.pointer || attr.allocatable) if ((attr.pointer || attr.allocatable) && attr.intent != INTENT_IN)
&& attr.intent != INTENT_IN && POINTER_TYPE_P (TREE_TYPE (scalar)))
gfc_add_modify (&se->post, scalar, gfc_add_modify (&se->post, scalar,
fold_convert (TREE_TYPE (scalar), fold_convert (TREE_TYPE (scalar),
gfc_conv_descriptor_data_get (desc))); gfc_conv_descriptor_data_get (desc)));
......
2014-03-27 Tobias Burnus <burnus@net-b.de>
PR fortran/58880
* gfortran.dg/finalize_24.f90: New.
2014-03-27 Michael Meissner <meissner@linux.vnet.ibm.com> 2014-03-27 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/p8vector-vbpermq.c: New test to test the * gcc.target/powerpc/p8vector-vbpermq.c: New test to test the
...@@ -43,8 +48,8 @@ ...@@ -43,8 +48,8 @@
2014-03-26 Fabien Chêne <fabien@gcc.gnu.org> 2014-03-26 Fabien Chêne <fabien@gcc.gnu.org>
PR c++/52369 PR c++/52369
* g++.dg/init/const10.C: New. * g++.dg/init/const10.C: New.
* g++.dg/init/const11.C: New. * g++.dg/init/const11.C: New.
* g++.dg/init/pr25811.C: Adjust. * g++.dg/init/pr25811.C: Adjust.
* g++.dg/init/pr29043.C: Likewise. * g++.dg/init/pr29043.C: Likewise.
......
! { dg-do compile }
!
! PR fortran/58880
!
! Contributed by Andrew Benson
!
module gn
type sl
integer, allocatable, dimension(:) :: lv
contains
final :: sld
end type sl
type :: nde
type(sl) :: r
end type nde
contains
subroutine ndm(s)
type(nde), intent(inout) :: s
type(nde) :: i
i=s
end subroutine ndm
subroutine sld(s)
implicit none
type(sl), intent(inout) :: s
return
end subroutine sld
end module gn
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