[Bug testsuite/63352] problem with fmt_g0_1.f08 on i386-pc-solaris2.11

richard at netbsd dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 24 12:25:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63352

--- Comment #1 from Richard PALO <richard at netbsd dot org> ---
This seems to be a bug in the write formatting for g0
Here is the compile with -fdump-parse-tree showing that the constant expression
is calculated exactly as '3.3333333333333331e-1_8'

Namespace: A-H: (REAL 4) I-N: (INTEGER 4) O-Z: (REAL 4)
procedure name = MAIN__
  symtree: 'MAIN__'      || symbol: 'MAIN__'       
    type spec : (UNKNOWN 0)
    attributes: (PROGRAM PUBLIC  SUBROUTINE)
  symtree: 'abort'       || symbol: 'abort'        
    type spec : (UNKNOWN 0)
    attributes: (PROCEDURE  SUBROUTINE)
  symtree: 'buffer'      || symbol: 'buffer'       
    type spec : (CHARACTER 50 1)
    attributes: (VARIABLE )
  symtree: 'string'      || symbol: 'string'       
    type spec : (CHARACTER 25 1)
    attributes: (VARIABLE IMPLICIT-SAVE)
    value: '(g0,g0,g0)               '

  code:
  WRITE UNIT=MAIN__:buffer FMT='(g0,g0,g0)'
  TRANSFER ':'
  TRANSFER 12340
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ':12340:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT=MAIN__:string
  TRANSFER ':'
  TRANSFER 0
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ':0:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT=MAIN__:string
  TRANSFER ':'
  TRANSFER 3.3333333333333331e-1_8
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ':.33333333333333331:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT='(1x,a,g0,a)'
  TRANSFER ':'
  TRANSFER 3.3333333333333331e-1_8
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ' :.33333333333333331:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT=MAIN__:string
  TRANSFER ':'
  TRANSFER 'hello'
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ':hello:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT='(g0,g0,g0,g0)'
  TRANSFER ':'
  TRANSFER .true.
  TRANSFER .false.
  TRANSFER ':'
  DT_END
  IF (/= MAIN__:buffer ':TF:')
    CALL _gfortran_abort ()
  ENDIF
  WRITE UNIT=MAIN__:buffer FMT='(g0,g0,'','',g0,g0)'
  TRANSFER '('
  TRANSFER (complex 1.2344999999999999_8 2.4567000000000001_8)
  TRANSFER ')'
  DT_END
  IF (/= MAIN__:buffer '(1.2344999999999999,2.4567000000000001)')
    CALL _gfortran_abort ()
  ENDIF



More information about the Gcc-bugs mailing list