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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |missed-optimization
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.01.12 11:10:22
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-12 
11:10:22 UTC ---
Sure, it is a missed optimization.  It's even "easy" to fix when you accept
a general compile-time slowdown (just schedule some CSE passes before
inlining).
When you want to avoid the compile-time slowdown then it's not so easy
(it's a usual trade-off with the case where there is no CSE opportunity but
earlier inlining would result in better code).

You can force GCC to not inline the function with using
__attribute__((const,noinline)) (but it of course will then be not
inlined at all).

Reply via email to