This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING^3] PR middle-end/18071 -Winline does not respect -fno-default-inline
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Manuel López-Ibáñez <lopezibanez at gmail dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 04 Mar 2007 14:48:15 -0800
- Subject: Re: [PING^3] PR middle-end/18071 -Winline does not respect -fno-default-inline
- References: <6c33472e0702071229q497ede7blfdbf27619d20ceba@mail.gmail.com> <6c33472e0702161016q25f83139n860a9ae6b29d7fa@mail.gmail.com> <6c33472e0702230129p521b9ccam36957a9f97a6ef2c@mail.gmail.com> <45EB2CE4.7010301@codesourcery.com> <6c33472e0703041417u7c291a88t407ba919ffc1c029@mail.gmail.com>
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