public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30389]  New: ACHAR() intrinsic gives erroneous errors in constant-folding.
@ 2007-01-06  1:55 brooks at gcc dot gnu dot org
  2007-01-06  2:12 ` [Bug fortran/30389] " jvdelisle at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-01-06  1:55 UTC (permalink / raw)
  To: gcc-bugs

According to the Fortran 95 standard, the result of ACHAR(I) for I not in the
range of 0 to 127 is "processor-dependent".  This implies that it _has_ a
result, and thus that it is legal code.  However, consider the following
result:

------------------------------------------------------------------------
debian-gfortran:~/test> cat achar.f90
write(*,*) achar(154)
end

debian-gfortran:~/test> ../bin-trunk/bin/gfortran achar.f90
achar.f90:1.17:

write(*,*) achar(154)
                1
Error: Extended ASCII not implemented: argument of ACHAR at (1) must be between
0 and 127
------------------------------------------------------------------------

This error is erroneous, and should be removed and a valid result of some sort
should be substituted.

(I will further note that this is inconsistent with what happens when the
ACHAR() call is not constant-folded.  It appears that, when the call is not
constant-folded, the result is simply that the least-significant 8 bits of I
are copied into the character.)


-- 
           Summary: ACHAR() intrinsic gives erroneous errors in constant-
                    folding.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: brooks at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-02-16 15:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-06  1:55 [Bug fortran/30389] New: ACHAR() intrinsic gives erroneous errors in constant-folding brooks at gcc dot gnu dot org
2007-01-06  2:12 ` [Bug fortran/30389] " jvdelisle at gcc dot gnu dot org
2007-01-11 20:55 ` tkoenig at gcc dot gnu dot org
2007-01-19 21:35 ` tkoenig at gcc dot gnu dot org
2007-01-22 20:35 ` patchapp at dberlin dot org
2007-01-27 16:35 ` patchapp at dberlin dot org
2007-01-28 10:45 ` tkoenig at gcc dot gnu dot org
2007-02-07  8:14 ` [Bug fortran/30389] [4.2, 4.1 only] " fxcoudert at gcc dot gnu dot org
2007-02-16 12:20 ` fxcoudert at gcc dot gnu dot org
2007-02-16 15:56 ` [Bug fortran/30389] [4.1 " fxcoudert 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).