This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/43366] [OOP][F2008] Intrinsic assign to polymorphic variable
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 10 Feb 2011 22:56:32 +0000
- Subject: [Bug fortran/43366] [OOP][F2008] Intrinsic assign to polymorphic variable
- Auto-submitted: auto-generated
- References: <bug-43366-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43366
--- Comment #11 from janus at gcc dot gnu.org 2011-02-10 22:56:21 UTC ---
Stupid question, but shouldn't it be possible to replace the call to
'is_scalar_reallocatable_lhs' by a check for the allocatable attribute?
Index: gcc/fortran/trans-expr.c
===================================================================
--- gcc/fortran/trans-expr.c (revision 169986)
+++ gcc/fortran/trans-expr.c (working copy)
@@ -6116,8 +6087,7 @@
if (lss == gfc_ss_terminator)
{
/* F2003: Add the code for reallocation on assignment. */
- if (gfc_option.flag_realloc_lhs
- && is_scalar_reallocatable_lhs (expr1))
+ if (gfc_option.flag_realloc_lhs && gfc_expr_attr (expr1).allocatable)
alloc_scalar_allocatable_for_assignment (&block, rse.string_length,
expr1, expr2);
AFAICS, the routine does not do anything more anyway, right?