User account creation filtered due to spam.

Bug 24917 - Handling of hexadecimal constants in gfortran
Summary: Handling of hexadecimal constants in gfortran
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.0.2
: P3 minor
Target Milestone: 4.1.0
Assignee: kargl
URL:
Keywords:
Depends on:
Blocks: 19292
  Show dependency treegraph
 
Reported: 2005-11-17 19:11 UTC by Ioannis E. Venetis
Modified: 2005-11-27 15:54 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2005-11-19 15:29:42


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ioannis E. Venetis 2005-11-17 19:11:36 UTC
Compilation of the following program TEST.f fails:

PROGRAM HEX_TEST
INTEGER(4) MASK
MASK = 'c0'X
END

~ $ gfortran -c TEST.f
 In file TEST.f:5



      MASK = 'c0'X
     1
Error: Unclassifiable statement at (1)

whereas the following code compiles correctly:

PROGRAM HEX_TEST
INTEGER(4) MASK
MASK = X'c0'
END

As stated in http://gcc.gnu.org/ml/fortran/2005-11/msg00382.html, the first version of the code is an extension which was supported in g77, therefore it should also be supported in gfortran.

The compiler I used to test this is:

~ $ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.2/configure
--prefix=/home/iev/apps/gcc-4.0.2 --enable-languages=c,c++,f95
--enable-shared --enable-threads=posix --disable-checking
--with-system-zlib --enable-__cxa_atexit --disable-libgcj --disable-nls
Thread model: posix
gcc version 4.0.2
Comment 1 Andrew Pinski 2005-11-17 20:16:39 UTC
Confirmed.
Comment 3 kargl 2005-11-27 15:47:59 UTC
Subject: Bug 24917

Author: kargl
Date: Sun Nov 27 15:47:56 2005
New Revision: 107568

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107568
Log:
PR fortran/24917
* primary.c (match_boz_constant):  Implement postfix BOZ constants;
  (match_string_constant): Peek for b, o, z, and x

* gfortran.dg/boz_6.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/boz_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/primary.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 kargl 2005-11-27 15:51:57 UTC
Subject: Bug 24917

Author: kargl
Date: Sun Nov 27 15:51:54 2005
New Revision: 107569

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107569
Log:
PR fortran/24917
* primary.c (match_boz_constant):  Implement postfix BOZ constants;
 (match_string_constant): Peek for b, o, z, and x

* gfortran.dg/boz_6.f90: New test.


Added:
    branches/gcc-4_1-branch/gcc/testsuite/gfortran.dg/boz_6.f90
Modified:
    branches/gcc-4_1-branch/gcc/fortran/ChangeLog
    branches/gcc-4_1-branch/gcc/fortran/primary.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 5 kargl 2005-11-27 15:54:35 UTC
Fixed.