(gfc_match_return): RETURN in main program is an extension.
        (gfc_match_block_data): A space is required before a block data
        name.
-       
+
+       PR fortran/16433
+       * primary.c (match_boz_constant): Call gfc_notify_std only if
+       we actually have a non-standard boz-literal-constant.
+
 2004-07-11  Joseph S. Myers  <jsm@polyomino.org.uk>
 
        * f95-lang.c (set_block): Remove.
 
 static match
 match_boz_constant (gfc_expr ** result)
 {
-  int radix, delim, length;
+  int radix, delim, length, x_hex;
   locus old_loc;
   char *buffer;
   gfc_expr *e;
   old_loc = gfc_current_locus;
   gfc_gobble_whitespace ();
 
+  x_hex = 0;
   switch (gfc_next_char ())
     {
     case 'b':
       rname = "octal";
       break;
     case 'x':
-      if (pedantic
-         && (gfc_notify_std (GFC_STD_GNU, "Extension: Hexadecimal "
-                            "constant at %C uses non-standard syntax.")
-             == FAILURE))
-       goto backup;
-
+      x_hex = 1;
       /* Fall through.  */
     case 'z':
       radix = 16;
       return MATCH_ERROR;
     }
 
+  if (x_hex
+      && pedantic
+      && (gfc_notify_std (GFC_STD_GNU, "Extension: Hexadecimal "
+                         "constant at %C uses non-standard syntax.")
+         == FAILURE))
+    {
+      gfc_free_expr (e);
+      return MATCH_ERROR;
+    }
+
   *result = e;
   return MATCH_YES;