questionnable nint() behavior
Dominique Dhumieres
dominiq@lps.ens.fr
Thu Mar 23 10:53:00 GMT 2006
Tim,
Thanks for the answer and tips.
> If ifc means an old Intel linux compiler
version 8.1
> the option for strict observance of parentheses (other than -O0)
> was -mp.
As far as I can tell ifc replace (f+a)-f by a with any option
I am using.
> In future versions of ifort, a better targeted option for that purpose
> is '-fp-model precise'.
Does not work with the version I am using.
> One might make a case for choosing the set of options closest
> to consistency with gfortran, when making comparisons.
First a general comment: istead of putting the blame on the user,
the different designers should be encouraged to avoid esoteric
flags for basic options and to do their best to use common syntax.
Secondly, this is the first time I realized that a compiler can
ignore the parentheses I put. I naively though it was mandatory
to obey them. I think this is a wrong user model: not only is he
stupid enough to write f+a-f, but he adds masochism to stupidity
by putting useless parentheses! Now what happens with
a0+x*(a1+x*(a2+...))
(Hoffner algorithm if my memory is not too bad)? Would the compiler
be allowed to rewrite it a0+a1*x+a2*x**2+... ?
Note that xlf obeys the parenthese up to -O2.
Last my point was not to compare compilers per se, but to see
how my code compiled with them. Since I found the problem with
xlf (beta), I gave a try to ifc and Portland group fortran too.
Dominique
More information about the Fortran
mailing list