This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Error in intrinsic.c


While applying the previous patch for PR17590 I moved a variable declaration 
to the top of its block, not noticing it was VLA that depended on preceding 
calculations. This seems to work by chance on i686 and crash other targets. 
Patch below fixes this.

Tested on i686-linux.
Applied to mainline.

Paul

2004-11-02  Paul Brook  <paul@codesourcery.com>

 * intrinsic.c (check_intrinsic_standard): Include error locus.
 Remove VLA.
 (gfc_intrinsic_func_interface, gfc_intrinsic_sub_interface): Pass
 locus to check_intrinsic_standard.

Index: intrinsic.c
===================================================================
RCS file: /var/cvsroot/gcc-cvs/gcc/gcc/fortran/intrinsic.c,v
retrieving revision 1.27
diff -u -p -r1.27 intrinsic.c
--- intrinsic.c 31 Oct 2004 01:24:29 -0000 1.27
+++ intrinsic.c 1 Nov 2004 18:29:06 -0000
@@ -2670,18 +2670,13 @@ gfc_init_expr_extensions (gfc_intrinsic_
    has chosen.  */
 
 static void
-check_intrinsic_standard (const char *name, int standard)
+check_intrinsic_standard (const char *name, int standard, locus * where)
 {
-  int name_len;
-  char msgstr[name_len + 53];
-
   if (!gfc_option.warn_nonstd_intrinsics)
     return;
 
-  name_len = strlen (name);
-  strncpy (msgstr, name, name_len + 1);
-  strncat (msgstr, " intrinsic is not included in the selected standard.", 
53);
-  gfc_notify_std (standard, msgstr);
+  gfc_notify_std (standard, "Intrinsic '%s' at %L is not included"
+    "in the selected standard", name, where);
 }
 
 
@@ -2794,7 +2789,7 @@ got_specific:
  }
     }
 
-  check_intrinsic_standard (name, isym->standard);
+  check_intrinsic_standard (name, isym->standard, &expr->where);
 
   return MATCH_YES;
 }
@@ -2851,7 +2846,7 @@ gfc_intrinsic_sub_interface (gfc_code * 
       return MATCH_ERROR;
     }
 
-  check_intrinsic_standard (name, isym->standard);
+  check_intrinsic_standard (name, isym->standard, &c->loc);
 
   return MATCH_YES;
 


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