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/28384] New: ICE on non-existent COMMON block


The "program"

      save /rbuf_char/
      end

produces:

0x080b503c in translate_common (common=0xa5005c0, var_list=Variable "var_list"
is not available.
)
    at ../../trunk/gcc/fortran/trans-common.c:965
965       if (common_segment->offset != 0)

I propose to fix this directly with

Index: gcc/fortran/trans-common.c
===================================================================
*** gcc/fortran/trans-common.c  (revision 115409)
--- gcc/fortran/trans-common.c  (working copy)
*************** translate_common (gfc_common_head *commo
*** 962,967 ****
--- 962,974 ----
        current_offset += s->length;
      }

+   if (common_segment == NULL)
+     {
+       gfc_error ("COMMON '%s' at %L does not exist",
+                common->name, &common->where);
+       return;
+     }
+
    if (common_segment->offset != 0)
      {
        gfc_warning ("COMMON '%s' at %L requires %d bytes of padding at start",

Paul


-- 
           Summary: ICE on non-existent COMMON block
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pault at gcc dot gnu dot org


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


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