public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/26586]  New: g77 -pedantic wrongly rejecting statement function
@ 2006-03-06 22:47 john dot harper at vuw dot ac dot nz
  2006-03-06 22:56 ` [Bug fortran/26586] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: john dot harper at vuw dot ac dot nz @ 2006-03-06 22:47 UTC (permalink / raw)
  To: gcc-bugs

The following Fortran 77 program declares and uses a statement function 
I2C(M). When compiled with these options:
  g77 -pedantic -v -save-temps 
it is misread as a character substring with its : missing, but IMHO
this statement function is valid in Fortran 77. The program compiles 
and runs OK if the -pedantic is removed. Below are the program listing, 
the compiler output, and the .s file generated by the compiler. 
There was no .i* file.

          tahi[~/Jfh] % cat testsf.f
      PROGRAM TESTSF
      CHARACTER I2C*2, CDIGIT(0:9)*1
      DATA CDIGIT/'0','1','2','3','4','5','6','7','8','9'/
* Statement function I2C to convert integer 0 to 99 to character*2
      I2C(M)   = CDIGIT(M/10) // CDIGIT(MOD(M,10))
* End of statement functions; start of executables
      PRINT '(10A3)', (I2C(M),M=0,99)
      END
tahi[~/Jfh]
tahi[~/Jfh] % g77 -pedantic -v -save-temps testsf.f
Driving: g77 -pedantic -v -save-temps testsf.f -lfrtbegin -lg2c -lm
-shared-libgcc
Reading specs from /usr/pkg/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.4/specs
Configured with: ./configure --prefix=/usr/pkg/gcc3 --host=sparc-sun-solaris2
--enable-shared --enable-languages=f77
Thread model: posix
gcc version 3.3.4
 /usr/pkg/gcc3/lib/gcc-lib/sparc-sun-solaris2/3.3.4/f771 testsf.f -quiet
-dumpbase testsf.f -auxbase testsf -pedantic -version -o testsf.s
GNU F77 version 3.3.4 (sparc-sun-solaris2)
        compiled by GNU C version 3.3.4.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
testsf.f: In program `testsf':
testsf.f:5:
         I2C(M)   = CDIGIT(M/10) // CDIGIT(MOD(M,10))
         1    2
Missing colon as of (2) in substring reference for (1)
testsf.f:7:
         PRINT '(10A3)', (I2C(M),M=0,99)
                          1    2
Missing colon as of (2) in substring reference for (1)
tahi[~/Jfh] %          
tahi[~/Jfh] % cat testsf.s
        .file   "testsf.f"
        .section        ".data"
        .align 8
        .type   cdigit.0, #object
        .size   cdigit.0, 10
cdigit.0:
        .ascii  "0"
        .ascii  "1"
        .ascii  "2"
        .ascii  "3"
        .ascii  "4"
        .ascii  "5"
        .ascii  "6"
        .ascii  "7"
        .ascii  "8"
        .ascii  "9"
        .global .rem
        .global .div
        .section        ".rodata"
        .align 8
.LLC1:
        .asciz  "(10A3)"
        .section        ".data"
        .align 4
        .type   __g77_cilist_0.1, #object
        .size   __g77_cilist_0.1, 20
__g77_cilist_0.1:
        .long   0
        .long   6
        .long   0
        .long   .LLC1
        .long   0
        .ident  "GCC: (GNU) 3.3.4"
tahi[~/Jfh] %


-- 
           Summary: g77 -pedantic wrongly rejecting statement function
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: john dot harper at vuw dot ac dot nz


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug fortran/26586] g77 -pedantic wrongly rejecting statement function
  2006-03-06 22:47 [Bug fortran/26586] New: g77 -pedantic wrongly rejecting statement function john dot harper at vuw dot ac dot nz
@ 2006-03-06 22:56 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-06 22:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-03-06 22:56 -------
Fixed in 4.0.0 with the gfortran rewrite.  3.4.6 is about to be released and
there is almost no way to get a non regression fixed.

So closing as fixed for 4.0.0.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |rejects-valid
      Known to fail|                            |2.95.3 3.2.3 3.3.2 3.3.3
                   |                            |3.4.0 3.0.4
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.0


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-03-06 22:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-06 22:47 [Bug fortran/26586] New: g77 -pedantic wrongly rejecting statement function john dot harper at vuw dot ac dot nz
2006-03-06 22:56 ` [Bug fortran/26586] " pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).