Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!motcsd!hpda!hpcuhb!hpcllla!daryl
From: daryl@hpcllla.HP.COM (Daryl Odnert)
Newsgroups: comp.sys.hp
Subject: Re: extreme performance degradation in c compiler on HP9000/835
Message-ID: <3770028@hpcllla.HP.COM>
Date: 27 Sep 89 18:22:08 GMT
References: <721@mit-amt.MEDIA.MIT.EDU>
Organization: Hewlett-Packard Calif. Language Lab
Lines: 23

An important note for C programmers who enable floating-point traps:

The Series 800 C compiler (in HP-UX release 3.0 I think) has added
a pragma that tells the optimizer that floating-point traps have been
enabled.  The primary effect of this pragma is to prevent invariant
floating-point operations from being moved out of a loop by the optimizer.

The syntax is as follows:

   #pragma FLOAT_TRAPS_ON  

The list of function names is not optional.  Unless a function is
specified in this list, the optimizer will assume it is safe to move
floating-point operations around.  (I have filed an enhancement
request that will allow an empty function name list to be interpreted
as "all functions in this compilation unit".)

Note that this pragma does not enable floating-point traps, it just
tells the optimizer that you have enabled them yourself (using an
assembly routine like the one I've posted in an earlier response.)

Daryl Odnert
HP California Languages Lab