From: Donald H. Mitchell
Subject: debug optimization declaration interaction with inline
Date: 
Message-ID: <1993Feb17.152939@trc.amoco.com>
We would like a way to choose to disable inlining (perhaps in order to
better debug or find callers).  CLtL2 does not specify any interaction
between the different optimization settings and inlining; however, it
seems rational to me to expect (declaim (optimize debug)) or even safety
to turn off all inlining.  What are vendors' policies?  Does dpANS spell
anything out in more detail?  Are there any suggestions for how to more
globally control inlining? 

Our best ideas: somehow catching the (declaim (inline ...)) [being a
macro, this doesn't appear trivial] or using a feature to switch inlining
on and off (i.e., #+inlining (declaim (inline ...)) ).  I don't like the
second at all (too discretionary and cluttering).

-- 
Don Mitchell			·········@trc.amoco.com
Proactive Solutions, Inc.	(918) 660-4270
10814 S. Quebec Ave.
Tulsa, OK 74137
From: Barry Margolin
Subject: Re: debug optimization declaration interaction with inline
Date: 
Message-ID: <1m10b3INNbpl@early-bird.think.com>
In article <················@trc.amoco.com> ······@trc.amoco.com (Donald H. Mitchell) writes:
>We would like a way to choose to disable inlining (perhaps in order to
>better debug or find callers).  CLtL2 does not specify any interaction
>between the different optimization settings and inlining; however, it
>seems rational to me to expect (declaim (optimize debug)) or even safety
>to turn off all inlining.  What are vendors' policies?  Does dpANS spell
>anything out in more detail?  Are there any suggestions for how to more
>globally control inlining? 

Sorry, nothing like this is specified in dpANS CL, and I don't think
anything about it was raised during the public review.

In Lucid CL, setting SPEED to 0 disables inline coding.  While it's not
really described well in CLtL2 or the dpANS, the intent of the DEBUG
optimization was to indicate whether the compiler should save information
needed by debuggers, such as local variable names, in the compiled code.
The choice of whether to inline code something is more of a time/space
tradeoff, so it makes sense to use SPEED optimization for it (also, the
DEBUG optimization didn't exist when Lucid was doing their implementation).

>Our best ideas: somehow catching the (declaim (inline ...)) [being a
>macro, this doesn't appear trivial] or using a feature to switch inlining
>on and off (i.e., #+inlining (declaim (inline ...)) ).  I don't like the
>second at all (too discretionary and cluttering).

While it isn't officially sanctioned by the standard, I expect most
implementations will do what you expect if you redefine the DECLAIM macro.
So you could have the macro check a global variable before processing an
INLINE declaration.

-- 
Barry Margolin
System Manager, Thinking Machines Corp.

······@think.com          {uunet,harvard}!think!barmar