This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran] PR34342 - BOZ diagnostic, Fortran 2003 BOZ, BOZ extensions


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 [1], where the
sender did not even realize that the result is not minus infinity. Or
the comp.lang.fortran thread of Wednesday [2]. 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
BOZ.)

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.

Tobias

[1] http://gcc.gnu.org/ml/fortran/2007-12/msg00084.html
[2]
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/2ad94287d7f8a6f0/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]