gcc 3.1 bug: flag_no_inline incorrectly set
Mark Mitchell
mark@codesourcery.com
Sun Apr 28 22:37:00 GMT 2002
--On Monday, April 29, 2002 09:09:12 AM +0930 Alan Modra
<amodra@bigpond.net.au> wrote:
> On Sun, Apr 28, 2002 at 11:48:15AM -0700, Mark Mitchell wrote:
>> I'm confused.
>
> You're not the only one. :) The patch fixes flag_no_inline and breaks
> flag_inline_trees/flag_instrument_function_entry_exit as you note.
>
> Does this make more sense?
>
> * c-common.c (c_common_post_options): Turn off inlining when
> instrumenting functions rather than when not instrumenting.
That makes more sense -- but I still don't get it. flag_inline_trees
is set to 1, right above that point; shouldn't it be set to 1 only
in the not-instrumenting-entry-and-exit case?
Furthermore, isn't the flag_no_inline stuff independent of
flag_instrument_function_entry_exit?
Why not something like this:
/* Normally, we want to inline using the tree inliner -- but
instrumentation of function entry and exit is not supported
when using the tree inliner, so we cannot use the tree inliner
in that case. */
flag_inline_trees = !flag_instrument_function_entry_exit;
if (!flag_no_inline)
flag_no_inline = 1;
/* If we're supposed to inline everything, and we're using the tree
inliner, set flag_inline_trees to 2 to indicate that, and turn off
flag_inline_functions so that the RTL inliner doesn't try to inline
things as well. */
if (flag_inline_functions && flag_inline_trees)
{
flag_inline_trees = 2;
flag_inline_functions = 0;
}
Overall, this stuff is something of a mess.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc-bugs
mailing list