On Fri, 8 Dec 2000, Patrik Stridvall wrote:
> What I mean is that a "heuristic" do not cover all strange
> cases like normal "algoritms" does and tries to be clever
> and make assumptions on how the input usually looks like.

What you seem to miss is that there are many problems where an
optimal algorithm does not exist.

For example, in SAT solving, which (apart from sorting) is probably
the very best researched set of algorithms, it is trivial to find a
simple algorithm. However, to achieve decent performance in general
you need to make "good" choices, and this is done by heuristics.

> This might lead to very strange results if there is strange input.

Not in this case (and many others).

> At best it will result in a sub-optimal result (and/or performance)

Again, there are many applications where an optimal algorithm does not
exist for Turing machines!

> In short I refer to algoritms that tries to be _too_ "clever" as
> heuristics while some uses it for normal "clever" algoritms as well.

I think that's the point. Your definition is rather non-standard.

> That said I remember reading somewhere that there are _some_
> optimizations that GNU C employs at higher (like -O6)

There's nothing like -O6 in GCC. -O3 is the maximum.

> optimization level that tries to be _too_ clever and thereby
> causing it to generate wrong code for some strange cases.

I'm not aware of any such optimization that breaks standards-compliant
code. That would be a bug. There are, however, optimizations that break
non-standards-compliant code, where the user tried to be too clever.

If you still think that GCC has a bug, please report this! Or, probably
better, ask at [EMAIL PROTECTED] whether the behavior you are seeing is
intended or really a bug. If you think the documentation is not clear
enough, a patch would be welcome as well!

Gerald
-- 
Gerald "Jerry" [EMAIL PROTECTED] http://www.dbai.tuwien.ac.at/~pfeifer/


Reply via email to