[PATH] PR/49139 fix always_inline failures diagnostics

Jakub Jelinek jakub@redhat.com
Tue May 31 12:28:00 GMT 2011


On Tue, May 31, 2011 at 11:18:18AM +0200, Richard Guenther wrote:
> The patch is not ok, we may not fail to inline an always_inline
> function.  To make this more consistent I proposed to warn
> whenever you take the address of an always_inline function
> (because then you can confuse GCC by indirectly calling
> such function which we might inline dependent on optimization
> setting and which we might discover we didn't inline only
> dependent on optimization setting).  Honza proposed to move

That would warn on a lot of valid programs.  Even
#include <unistd.h>
void *readptr = read;
would warn, because read is both extern and
extern __inline __attribute__ ((__always_inline__, __artificial__, __gnu_inline__, __warn_unused_result__)) ssize_t
read (int __fd, void *__buf, size_t __nbytes)
{
  ...
}
wrapper.  Similarly dozens of other functions.  glibc relies on
extern inline gnu_inline behavior there, if you take address, the
extern is used instead of the inline.

	Jakub



More information about the Gcc-patches mailing list