This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/58880] [4.9 Regression] [OOP] ICE on valid with FINAL function and type extension
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Mar 2014 13:16:31 +0000
- Subject: [Bug fortran/58880] [4.9 Regression] [OOP] ICE on valid with FINAL function and type extension
- Auto-submitted: auto-generated
- References: <bug-58880-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58880
--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Draft patch.
Janus: As you have a better idea when vtables are generated: Have you an idea
why the finalization wrapper__final_gn_Nde is not produced? And how to fix
that?
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -71,2 +71,5 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar,
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),
@@ -77,4 +80,3 @@ gfc_conv_scalar_to_descriptor (gfc_se *se, tree scalar,
if the actual argument is a pointer and not, e.g., NULL(). */
- if ((attr.pointer || attr.allocatable)
- && attr.intent != INTENT_IN && POINTER_TYPE_P (TREE_TYPE (scalar)))
+ if ((attr.pointer || attr.allocatable) && attr.intent != INTENT_IN)
gfc_add_modify (&se->post, scalar,