[Bug c/55830] inline and __attribute__((always_inline)) treated differently for unused-function warning

2013-02-28 Thread colanderman at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55830



Chris King  changed:



   What|Removed |Added



 CC||colanderman at gmail dot

   ||com



--- Comment #5 from Chris King  2013-02-28 
18:18:37 UTC ---

This is good.  I like that I can specify __attribute__ ((always_inline)) on

local static functions and still be warned if they are unused.  IMHO the real

bug is that such usage triggers a "warning: always_inline function might not be

inlinable".



If this bug and/or the above warning behavior is valid, then what's the

"correct" way to say "I want my local static function to be always inlined, but

don't hide warnings if it's unused"?


[Bug c/55830] inline and __attribute__((always_inline)) treated differently for unused-function warning

2012-12-30 Thread sch...@linux-m68k.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55830



--- Comment #4 from Andreas Schwab  2012-12-30 22:12:28 
UTC ---

static alone already makes a function eligible for inlining.


[Bug c/55830] inline and __attribute__((always_inline)) treated differently for unused-function warning

2012-12-30 Thread brooks at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55830



--- Comment #3 from Brooks Moses  2012-12-30 
21:50:08 UTC ---

Andrew: Oh, interesting.  So perhaps this is really a failure to warn (or

error?) for a case where "__attribute__((always_inline))" isn't used with

"inline", and a case of missing documentation on the always_inline attribute?



FWIW, the additional "inline" certainly doesn't seem to be needed in practice

for GCC to inline the code.


[Bug c/55830] inline and __attribute__((always_inline)) treated differently for unused-function warning

2012-12-30 Thread brooks at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55830



--- Comment #2 from Brooks Moses  2012-12-30 
21:46:02 UTC ---

Created attachment 29064

  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29064

Minimal test case



The attached test case illustrates the problem.  When compiled with -Wall

-Wextra -Werror, it reports:



  bug55830.c:6:44: warning: 'bar' defined but not used



However, it does not report a similar warning for 'foo'.


[Bug c/55830] inline and __attribute__((always_inline)) treated differently for unused-function warning

2012-12-30 Thread pinskia at gcc dot gnu.org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55830



--- Comment #1 from Andrew Pinski  2012-12-30 
21:42:28 UTC ---

IIRC always_inline really needs inline also.