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/32555] [4.3 Regression] Miscompilation of NIST testsuite



------- Comment #2 from burnus at gcc dot gnu dot org  2007-06-30 06:49 -------
> FM403.f, FM900.f, and FM903.f fail to compile.
> I have confirmed this regression is caused by.
>
> 2050  FORMAT(2PF8.3,-2PE9.4,F9.4,0PF9.4,9X,-2PE9.4,F9.4)                
>                                   1
> Error: Unexpected element in format string at (1)

The problem is that the big case block in check_format was checking only for
  FMT_POSINT
and (for "k P", Fortran2003: R1011/R1012) for FMT_SIGNED_INT; however,
format_lex can return another state: FMT_ZERO. But due to a bug it was never
returned.

As P seems to be the only element where zero is allowed, I did the patch as
follows. I'm not sure I can submit the patch in the coming days; feel free to
submit it.

Index: gcc/fortran/io.c
===================================================================
--- gcc/fortran/io.c    (Revision 126114)
+++ gcc/fortran/io.c    (Arbeitskopie)
@@ -487,6 +487,7 @@ format_item_1:
       goto format_item;

     case FMT_SIGNED_INT:
+    case FMT_ZERO:
       /* Signed integer can only precede a P format.  */
       t = format_lex ();
       if (t != FMT_P)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-30 06:49:13
               date|                            |


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


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