This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [PING^3] PR middle-end/18071 -Winline does not respect -fno-default-inline


Manuel López-Ibáñez wrote:

> The problem is that DECL_DECLARED_INLINE_P has two meanings. It
> controls the linkage and it also denotes which functions were
> explicitly declared inline. Since both meanings can contradict in this
> case (a function was not declared inline but it has "inline linkage"),
> it is impossible to detect this case with just one flag.
> 
> So, I am not sure how this can be solved. Adding yet another flag to
> each tree node just to handle this case seems a bit overkill to me.

Perhaps you could warn at the point that a function declared
DECL_DECLARED_INLINE_P has the DECL_INLINE flag cleared.  For the C++
case with -fno-default-inline this warning would never be issued because
DECL_INLINE is never set for such functions.  For cases where we decide
it is unprofitable to inline the function, and therefore clear
DECL_INLINE, issue a warning:

  warning: `f' will never be inlined because <something>

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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