This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/49708] [4.5/4.6/4.7 Regression] ICE with allocate and no dimensions


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49708

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.07.12 12:27:33
     Ever Confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org 2011-07-12 12:27:33 UTC ---
(In reply to comment #1)
> In principle, the check is still in resolve.c - the question is: Why doesn't it
> trigger?

Apparently because of the pointer attribute. Changing "pointer" to
"allocatable" in the test case will trigger the error message.

With the following patch one also gets the error message for the pointer case,
but I haven't checked if this breaks anything else:


Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c    (revision 175788)
+++ gcc/fortran/resolve.c    (working copy)
@@ -6884,7 +6884,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code
       gfc_find_derived_vtab (ts.u.derived);
     }

-  if (pointer || (dimension == 0 && codimension == 0))
+  if (dimension == 0 && codimension == 0)
     goto success;

   /* Make sure the last reference node is an array specifiction.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]