This is the mail archive of the gcc@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: Should -fcross-jumping be part of -O1?


Robert Dewar <dewar@gnat.com> writes:

| > I know.  There are many and many. Many users of fpt also can't
| > understand why someone would value speed over correctness when
| > correctness is the purpose of the computation.
| 
| That's going too far. When you get different results in a Fortran
| compiler at -O0 and -O2, then there is no absolute judgment that one
| semantics is more correct than the other.

Please, who mentions Fortran compared to language X?

I don't think it is appropriate to add more to the confusion.

| Most likely on an x86, the
| optimized version will in fact give more accurate results. Of course
| predictability may be more important than accuracy, but it is not
| helpful to use the word correct in this context.

Sure it is.  If the result falls into the predicted interval, and
therefore the expected decision is made based on that then then the
computation is correct.

[...]

| So I think it is better to avoid using correct here, it is just a
| rhetorical device with no particular content.

That is an artefact of your rheterics. "correct" does have a useful
content.  It is no 

There is a whole branch of mathematical approach to numerics based on
interval aritmetic upon which on can base sofwtare construction with
predictable results -- as far as the compiler implementer does not go
his way of playing language lawyering non-sense.  Have a look for
example how interval airthmetic are used in computation geometry
(http://www.cgal.org/ being the most popular), or in CAGD where it is
quite important to get the correct topological structrure of shapes.
In such context, algorithms are most of the time based on combination
of numeric and symbolic computation and it is far more important to
get a (numeric) computation correct than to get it fast.

"correct" is not a rhetorical device.  

I don't time left, and I'm not quite interested in distractive
language lawyering game. But I feel it is really misleading to
outright reject (correctness, predictability which together imply)
reproducibility. 

[...]

| These four criteria are quite different. Note in particular, that
| you are identifying correctness with reproducibility, but I think that
| most people who would like to use the term would identify it with
| predictability, which is a different criterion (predictability
| implies reproducibility, but not vice versa).
|
| You surely in fact shift in your use of the term. At first in your
| message you are definitely talking about reproducibility (after all
| this whole thread was about effects of optimization). But at the end
| where you say:
| 
| "correctness is the purpose of the computation" I think you must be
| talking about predictability.
| 
| But of course there are others for whom floating-point arithmetic is
| simply an approximation of real arithmetic. With this view, the
| computation is never correct, but doing it with maximum precision is
| at least the most correct possible.
| 
| That's why correctness is a bad term.

No, I don't think so.  "Correct" always implies expected results in a
given context.  It may become bad only when/if one plays distractive
lawyering, but then that is true for virtually anything.

-- Gaby


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