On 1/26/07, Daniel Berlin <[EMAIL PROTECTED]> wrote:
>
> > Every leading C compiler has for years done things like this to boost
> > performance on scientific codes.
>
> The Sun cc is a counter-example. And even then, authors of scientific
> code usually do read the compiler manual, and will discover any
> additional optimizer flags.
>
Errr, actually, Seongbae, who worked for Sun on Sun CC until very
recently, says otherwise, unless i'm mistaken.
Seongbae, didn't you say that Sun's compiler uses the fact that signed
overflow is undefined when performing optimizations?
Correct.
Sun's SPARC backend even had a compiler flag that tells the optimizer
to ignore overflow case for unsigned integer
which I believe is used in some of the SPEC CPU submissions.
There's no equivalent flag for signed integer because it's default,
and we've never had a problem with it -
there were bugs filed against it, and when customers were told
signed integer overflow is undefined in the standard,
they went back and fixed their code.
I believe HP's compiler does the similar,
although they also provide an option to override the default behavior
of ignoring the integer overflow at high optimization level
(see their documentation about +Ointeger_overflow= flag).
IBM xlc has very similar approach, IIRC.
--
#pragma ident "Seongbae Park, compiler, http://seongbae.blogspot.com"