If I define foo() to be static, then in both LTO and non-LTO cases foo() gets inlined despite -Os. So, I guess noinline attribute is our best bet to get expected behavior in this case.
If I define foo() to be static, then in both LTO and non-LTO cases foo() gets inlined despite -Os. So, I guess noinline attribute is our best bet to get expected behavior in this case.