This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran] PR34342 - BOZ diagnostic, Fortran 2003 BOZ, BOZ extensions
- From: Tobias Burnus <burnus at net-b dot de>
- To: Jerry DeLisle <jvdelisle at verizon dot net>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>
- Date: Sat, 08 Dec 2007 10:42:56 +0100
- Subject: Re: [Patch, Fortran] PR34342 - BOZ diagnostic, Fortran 2003 BOZ, BOZ extensions
- References: <4758761F.firstname.lastname@example.org> <4759FAFB.email@example.com>
Jerry DeLisle wrote:
> I have not had a chance to review yet. Maybe tomorrow. Is this
> getting into the new features area that should wait for 4.4 branch?
> Or is it really a bug?
Well, depends on the definition; I think that several bug reporters
regard the current behaviour for
DATA real_variable/ 'b0'z /
a bug; as the behaviour is not defined in the Fortran standard, one can,
however, regard these changes as new feature.
The problem is that old program simply assume that the BOZ is regarded
as bit pattern, which leads to wrong results (as long as the range check
does not catch it). An example is the SLATEC library (Wednesday's PR
34345), or the program mentioned in yesterday's email , where the
sender did not even realize that the result is not minus infinity. Or
the comp.lang.fortran thread of Wednesday . See also PRs 34342,
18026, 29471 and the duplicates 23074, 2951, 33001, 33002.
It is also kind of a regression with regards to g77 as the latter had
the option -ftypeless-boz.
The Fortran 2003 BOZ are new features, but they came as trivial
implementation as soon as I had the other parts.
(I actually started with implementing only a -std=f2003 error in DATA
for non-integer variables, which introduced expr->is_boz; I then wanted
to add a warning to REAL/CMPLX/DBLE that the BOZ is not regarded as
Fortran 2003 BOZ, until I realized that instead of the gfc_warning I
could also use gfc_simplify_transfer, which implements the Fortran 2003
I think the changes are rather localized, especially for the Fortran
2003 BOZ, which should allow the inclusion in stage 3. Though, if
desired, I can also split off the Fortran 2003 BOZ part.
> I have similar question for the reading of "NaN" and "Infinity" patch.
This belongs also into the category of what is a bug and what is a new
feature. I think one can find arguments for both. The patch fixes the
last known inf/nan deficit apart from Fortran 2003's IEEE modules. This
patch is also relatively trivial and should not affect non-INF/NaN
numbers and make parsing not slower as the code has been added just
before "goto bad;". But if you say that it makes sense to hold off the
patch until 4.4, I can certainly do so.