chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] inliner bug


From: Felix
Subject: Re: [Chicken-hackers] inliner bug
Date: Mon, 11 Mar 2013 07:36:03 -0400 (EDT)

From: John Cowan <address@hidden>
Subject: Re: [Chicken-hackers] inliner bug
Date: Sun, 10 Mar 2013 19:35:46 -0400

> Felix scripsit:
> 
>> By adding the "inline" declaration, you are effectively disabling
>> this size test, telling the compiler:   "Inline this! Always! Now
>> go and do what I command!"
> 
> That's ... just wrong.  An inline declaration should be a SHOULD,
> not a MUST.  In particular, the compiler should at a minimum detect
> that it is recursively inlining and stop.  A notinline declaration,
> on the other hand, must be a MUST.  This is what Common Lisp says:
> the compiler can always ignore an inline declaration, but a notinline
> declaration is the only one (apart from a special-variable declaration,
> which affects semantics) that MUST NOT be ignored.

It is irrelevant what Common Lisp says - a declaration can nearly
always be considered a SHOULD, and a compiler may very well decide to
inline something which has been declared notinline if it can prove
that the semantics don't change. Declarations do not work on the
language level anymore (and that particular case your mentioning -
special declarations - can be considered one of the most spectacular
warts of CL), they are just hints to the implementation. 

So the question is rather: what is more intuitive or what may actually
confuse the user? And on that line of argument I agree with you
completely that the current behaviour is not that great.

Recursive inlining may be desired, BTW. In a TCO-optimized language
this is the same as loop-unrolling.


cheers,
felix



reply via email to

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