How to avoid some built-in expansions in gcc?

Michael Matz matz@suse.de
Tue Jun 4 17:43:40 GMT 2024


Hello,

On Tue, 4 Jun 2024, Richard Biener wrote:

> >> A pragmatic solution might be a new target hook, indicating a specified
> >> builtin is not to be folded into an open-coded form.
> > 
> > Well, that's what the mechanism behind -fno-builtin-foobar is supposed to
> > be IMHO.  Hopefully the newly added additional mechanism using optabs and
> > ifns (instead of builtins) heeds it.
> 
> -fno-builtin makes GCC not know semantics of the functions called 

Hmm, true.  Not expanding inline is orthogonal strictly speaking ...

> which is worse for optimization than just not inline expanding it.

... but on AVR expanding inline is probably worse than that lost 
knowledge.  So yeah, ideally we would devise a (simple/reasonable) way to 
at least disable inline expansion, without making it non-builtin.

(Well, and without reverse-recognition of isfinite-like idioms in the 
sources.  That's orthogonal as well.)


Ciao,
Michael.

> 
> Richard 
> 
> >> A good solution would base this on (size) costs, the perfect solution
> >> would re-discover the builtins late and undo inlining that didn’t turn
> >> out to enable further simplification.
> >> 
> >> How is inlined isdigit bad on AVR?  Is a call really that cheap
> >> considering possible register spilling around it?
> > 
> > On AVR with needing to use 8bit registers to do everything?  I'm pretty
> > sure the call is cheaper, yeah :)
> > 
> > 
> > Ciao,
> > Michael.
> 


More information about the Gcc mailing list