tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Implementing gcc intrinsics


From: Michael Matz
Subject: Re: [Tinycc-devel] Implementing gcc intrinsics
Date: Thu, 14 Apr 2016 14:57:34 +0200 (CEST)
User-agent: Alpine 2.20 (LSU 67 2015-01-07)

Hi,

On Wed, 13 Apr 2016, Sergey Korshunoff wrote:

> > I can see that for inlines there is a separate `InlineFunc` struct 
> > that keeps function body until end of generation when in 
> > `gen_inline_functions` only the referenced inlines are generated as 
> > regular functions.
> 
> Then we can search if a function to call is inline function and if so, 
> parse this function body in the form of the {( )} block. A compiler 
> switch can be used to keep old bejavior

You will find that this will not work very well.  Parameter passing is one 
problem, scoping another and recursive calls another.  Parsing as ({}) 
block doesn't deactive the outer variables, so what should be a compile 
error might turn into silently accepting wrong code, or into accessing a 
local instead of a global variable.  Functions can call themself 
recursively, parsing them as ({}) block that's impossible to implement.

Also: for tcc inlining makes no sense whatsoever.  There is no optimizer 
that could benefit from inlining, the only thing saved would be a call and 
return, which is a silly optimization.


Ciao,
Michael.



reply via email to

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