This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Committed] PR fortran/54072 -- More fun with BOZ
- From: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- To: Mark Eggleston <mark dot eggleston at codethink dot co dot uk>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 7 Aug 2019 11:56:18 -0700
- Subject: Re: [Committed] PR fortran/54072 -- More fun with BOZ
- References: <20190723230520.GA33409@troutmask.apl.washington.edu> <9ca1a4cd-579d-d90d-4096-348740f70b71@codethink.co.uk> <20190807160949.GA15627@troutmask.apl.washington.edu>
- Reply-to: sgk at troutmask dot apl dot washington dot edu
On Wed, Aug 07, 2019 at 09:09:49AM -0700, Steve Kargl wrote:
> On Wed, Aug 07, 2019 at 01:58:17PM +0100, Mark Eggleston wrote:
> >
> > DATA statements for logical and character variable compile but do not work:
> >
> > program test
> > character(4) :: c
> > data c / z'41424344' /
> > write(*, *) "'" // c // "'", transfer(c, 0_4)
> > end program test
> >
> > Outputs:
> >
> > '' 0
Prior versions of gfortran give
% gfc9 -c a.f90
a.f90:3:10:
3 | data c / z'41424344' /
| 1
Error: Incompatible types in DATA statement at (1); attempted conversion of INTEGER(16) to CHARACTER(1)
I have a patch that now does
gfcx -c a.f90
a.f90:3:10-23:
3 | data c / z'41424344' /
| 1 2
Error: data-stmt-object at (1) has type 'CHARACTER', which conflicts with the BOZ literal constant at (2)
BTW, -fallow-invalid-boz does enable all previous broken
usages of BOZ. For example, BOZ can be an actual argument
in only a few intrinsic subprograms listed in F2018. I've
allowed only a few exceptions such as AND(z'1234',4242)
which mirros IAND() is documented behavior.
PS: Have you gotten write access to the source code repository, yet?
--
Steve