[PATCH][3.3] PR 7257 (flag_inline_functions doesn't show up with -fverbose-asm)

Steven Bosscher s.bosscher@student.tudelft.nl
Mon Apr 7 17:02:00 GMT 2003


Op ma 07-04-2003, om 18:05 schreef Zack Weinberg:
> Steven Bosscher <s.bosscher@student.tudelft.nl> writes:
> 
> > Op za 05-04-2003, om 21:22 schreef Zack Weinberg:
> >> Here is my suggestion:  Add a boolean field to the langhooks
> >> structure, uses_rtl_inliner.  The default for this field is false.
> >> Make the Fortran and Ada front ends override it to true.  (I think
> >> those are the only statement-at-a-time front ends left.)  Then remove
> >> flag_inline_trees entirely.  Instead, have both the RTL and tree
> >> inliners look at flag_inline_functions to decide what to do, but
> >> disable each one entirely if uses_rtl_inliner says so.
> >
> > Something like this?  Bootstrapped and regtested on i586-pc-linux-gnu.
> 
> Still not quite what I had in mind.  You shouldn't have to frob
> flag_inline_functions at all; you should have the tree inliner
> use the same logic that the RTL inliner uses, to decide whether
> to inline functions explicitly marked so.

With flag_inline_trees we also inline functions not explicitly marked
so.

>  That should make this
> 
> > ! /* Until the RTL inliner finally dies for real, this flag has twisted
> > !    semantics.
> > ! 
> > !    If the front end uses the tree inliner,
> > !    0 means we should not perform inlining.
> > !    1 means we should expand functions calls inline at the tree level.
> > !    2 means we should consider *all* functions to be inline candidates.
> > ! 
> > !    For front ends still using the RTL inliner, nonzero means it is ok
> > !    to inline at the RTL level all functions that look like good inline
> > !    candidates.  */
> 
> unnecessary.

Hmm, I fail to understand how you want to do this.  Let me explain how I
came up with this patch, hope you can point out my thinko(s).

We need to represent four different things with flag_inline_functions:
1) Inline nothing at all.
2) Inline available functions with the RTL inliner
   (i.e. what flag_inline_functions used to imply).
3) Inline all available "inline" functions at the tree level
   (flag_inline_trees == 1)
3) Inline *all* available functions at the tree level
   (flag_inline_trees == 1)

Case (1) is easy: flag_inline_functions == 0 is enough.  For the other
cases, having just flag_inline_functions and uses_rtl_inliner is not
enough:

		flag_inline_functions	uses_rtl_inliner
Case (1)		0			any
Case (2)		1			1
Case (3)		1			0
Case (4)		?			0

So we need a second value of flag_inline_functions to distinguish
between cases (3) and (4).  This is a result of the fact that the RTL
inliner only has one inlining mode (inline all functions), whereas the
tree inliner has two different modes:  You cannot apply the logic of the
RTL inliner to the tree inliner.

Am I missing something?

> > Frankly I like the other fix better.
> 
> Is this because of the above?

Yes, and also because I don't like putting such big patches on a release
branch.

Greetz
Steven




More information about the Gcc-patches mailing list