This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Sigh. Inlining heuristics.


Mark Mitchell <mark@codesourcery.com> writes:

>>
>> However, we'll still mark  it to be inlined *anyway*. Observe:
>>
>> #include <stdio.h>
>> struct S { void f(); };
>> void S::f() {
>> printf ("blah\n");
>> }
>>
>> int main(void)
>> {
>>         S a;
>>         a.f();
>> }
> 
> Yes, we should not inline `S::f' here.  But, we don't, using
> the 3.0 build I have on i686-pc-linux-gnu, with -O2.  What is
> different?

I'm using -O3.
At -O2, it doesn't inline it.

> 
> -- 
> Mark Mitchell                mark@codesourcery.com
> CodeSourcery, LLC            http://www.codesourcery.com

-- 
"I used to be a waiter, but I was fired for clearing tables.  I
was clearing them for take off.  I had them all lined up
outside.  People thought it was an outdoor cafe.  I said, "No,
these are leaving at 3."  They were going to fire me anyway,
because I told them I thought they should put the wrapper on the
inside of the straw since that's the part you don't want to get
dirty.
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]