[Bug tree-optimization/47255] Missed CSE optimization with inline functions, and __attribute__((const))
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jan 12 11:59:00 GMT 2011
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).
More information about the Gcc-bugs
mailing list