stb.c (ffestb_R100110_): Allow the number before the X format to be optional when...
authorRoger Sayle <roger@eyesopen.com>
Sat, 15 Mar 2003 19:17:50 +0000 (19:17 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Sat, 15 Mar 2003 19:17:50 +0000 (19:17 +0000)
* stb.c (ffestb_R100110_): Allow the number before the X format
to be optional when not -fpedantic.
* std.c (ffestd_R1001dump_1010_3_): Delete unused static function.
(ffestd_R1001dump_): For the FFESTP_formattypeX case, call
ffestd_R1001dump_1010_2_ instead of ffestd_R1001dump_1010_3_.

* g77.f-torture/compile/xformat.f: New test case.

From-SVN: r64415

gcc/f/ChangeLog
gcc/f/stb.c
gcc/f/std.c
gcc/testsuite/ChangeLog
gcc/testsuite/g77.f-torture/compile/xformat.f [new file with mode: 0644]

index 0166c195b745cf576cc6bdfdb8a07e409aeb7f86..73eddc137e3f66eca5ffef382623e24923f20e2f 100644 (file)
@@ -1,3 +1,11 @@
+2003-03-15  Roger Sayle  <roger@eyesopen.com>
+
+       * stb.c (ffestb_R100110_): Allow the number before the X format
+       to be optional when not -fpedantic.
+       * std.c (ffestd_R1001dump_1010_3_): Delete unused static function.
+       (ffestd_R1001dump_): For the FFESTP_formattypeX case, call
+       ffestd_R1001dump_1010_2_ instead of ffestd_R1001dump_1010_3_.
+
 2003-03-15  Roger Sayle  <roger@eyesopen.com>
 
        * f/ste.c (ffeste_R810): Fix whitespace.
index bf456a1afc13415cc68e430b2165cf6fd46f0466..57d7ac333133835c669dba6a08f5b6ca74ef07b4 100644 (file)
@@ -10514,7 +10514,7 @@ ffestb_R100110_ (ffelexToken t)
 
        case FFESTP_formattypeX:
          err = FFEBAD_FORMAT_BAD_X_SPEC;
-         pre = required;
+         pre = ffe_is_pedantic() ? required : optional;
          post = disallowed;
          dot = disallowed;
          exp = disallowed;
index bd2add21f6523411a50b68b9c7c887eb70af7f30..c9ff189b79677fe7b523c515bf8b77775ad64ccb 100644 (file)
@@ -532,8 +532,6 @@ static void ffestd_R1001dump_1010_1_ (ffests s, ffesttFormatList f,
                                      const char *string);
 static void ffestd_R1001dump_1010_2_ (ffests s, ffesttFormatList f,
                                      const char *string);
-static void ffestd_R1001dump_1010_3_ (ffests s, ffesttFormatList f,
-                                     const char *string);
 static void ffestd_R1001dump_1010_4_ (ffests s, ffesttFormatList f,
                                      const char *string);
 static void ffestd_R1001dump_1010_5_ (ffests s, ffesttFormatList f,
@@ -3608,7 +3606,7 @@ ffestd_R1001dump_ (ffests s, ffesttFormatList list)
          break;
 
        case FFESTP_formattypeX:
-         ffestd_R1001dump_1010_3_ (s, next, "X");
+         ffestd_R1001dump_1010_2_ (s, next, "X");
          break;
 
        case FFESTP_formattypeS:
@@ -3914,26 +3912,6 @@ ffestd_R1001dump_1010_2_ (ffests s, ffesttFormatList f, const char *string)
   ffests_puts (s, string);
 }
 
-/* ffestd_R1001dump_1010_3_ -- Dump a particular format
-
-   ffesttFormatList f;
-   ffestd_R1001dump_1010_3_(f,"I");
-
-   The format is dumped with form nX.  */
-
-static void
-ffestd_R1001dump_1010_3_ (ffests s, ffesttFormatList f, const char *string)
-{
-  assert (f->u.R1010.val.present);
-
-  if (f->u.R1010.val.rtexpr)
-    ffestd_R1001rtexpr_ (s, f, f->u.R1010.val.u.expr);
-  else
-    ffests_printf (s, "%lu", f->u.R1010.val.u.unsigned_val);
-
-  ffests_puts (s, string);
-}
-
 /* ffestd_R1001dump_1010_4_ -- Dump a particular format
 
    ffesttFormatList f;
index 793c793fbfb448017ebf75fb007f248c07ada1b0..92db48b943856c6d95f887efec6335e45af67b78 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-15  Roger Sayle  <roger@eyesopen.com>
+
+       * g77.f-torture/compile/xformat.f: New test case.
+
 2003-03-15  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * g++.old-deja/g++.mike/eh33.C: Remove xfail for hppa*-*-*.
diff --git a/gcc/testsuite/g77.f-torture/compile/xformat.f b/gcc/testsuite/g77.f-torture/compile/xformat.f
new file mode 100644 (file)
index 0000000..7e9001c
--- /dev/null
@@ -0,0 +1,3 @@
+       PRINT 10, 2, 3
+10     FORMAT (I1, X, I1)
+       END