On 2021-05-01 00:43:27 +0000, Kyryl Melekhin wrote: > Yakov <exeb...@gmail.com> wrote: > > > Kyryl you cannot inline everything because you will get code > > explosion, often infinite code explosion when functions have a > > circular dependency on each other. I am just talking about inlining > > certain functions carefully chosen by a programmer. > > Yeah, I get that. That's why it is so hard to make such a tool. > Because recursion is hard to decompose, so the inliner has to be > smart enough to actually rewrite the recursive solution iteratively > otherwise it will blow up.
In general, programmers mark functions as inline only when this does not involve a recursion, though they are not obliged to do so. With function-like macros, the preprocessor automatically disables recursion. I suppose that the compiler can do the same thing with inline functions (but it may also choose a higher recursion level). Since tcc obviously supports function-like macros, handling recursion for inline functions would not introduce a new difficulty. -- Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/> 100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/> Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel