[J3] function references and optimization

Robert Corbett rpcorbett at att.net
Tue Oct 9 18:09:05 EDT 2018

My concern is with what the Fortran
standard allows, not with what a
particular implementation does.
Oracle Fortran was intended to
conform to the requirements of
the Fortran standard by default.
Oracle Fortran has a catch-all
optimization option -fast which
allows aggressive optimizations.

I picked a bad example.
A better example would be the
statement function

      f(x) = x - 1.0

and the assignment statement

      y = f(z) + 1.0

I suspect that at high optimization
levels, Oracle Fortran would
replace the expression f(z) + 1.0
with the expression z.  The
optimization would change the
results even for normal values
of z.  I might be wrong, as I can
longer can easily check what
Oracle Fortran does.

Robert Corbett

> On Oct 9, 2018, at 1:48 PM, Van Snyder via J3 <j3 at mailman.j3-fortran.org> wrote:
>> On Tue, 2018-10-09 at 20:42 +0000, Bill Long via J3 wrote:
>> I would say that the vendors cannot make “pedantic standard conforming
>> optimization” the default.  But generally, Tom got it right. Pissing
>> off the people paying the bills is bad business 
> I suspect that no vendor's user community is homogeneous.  So each
> vendor has to decide which smaller subset of customers to piss off.
> There's no problem with offering optimizations that violate or extend
> the standard, but hiding them behind useful-sounding euphemisms like
> "aggressive optimization" isn't helpful to at least some subset of
> users.  Deleting them altogether would piss off a larger subset.  It's
> not obvious that requiring to request them explicitly would really piss
> off anybody enough to stop paying the bills.

More information about the J3 mailing list