bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GNU attributes


From: Derek Robert Price
Subject: Re: GNU attributes
Date: Tue, 25 Mar 2003 12:18:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20030208 Netscape/7.02

Guus Leeuw jr. wrote:

Derek,

Taking a bit from the cluebook from gcc3.0.2, an optimizer may only reduce the number calls to the function, iff a) the parameter values are guaranteed the same (i.e. static or non changing variable); b) the global variable values used by the pure function are guaranteed to be the same from call to call;

If the optimizer decides a) and b) hold, you should be safe, even when malloc()ing. It will only compute the result once, a re-use it. But then,

Okay, that was my interpretation as well but I wasn't quite sure. Thanks for the help.

Derek

--
               *8^)

Email: derek@ximbiot.com

Get CVS support at <http://ximbiot.com>!
--
Nobody ever loved me that much.

                - Humphrey Bogart as Rick, _Casablanca_







reply via email to

[Prev in Thread] Current Thread [Next in Thread]