This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48092] associative property of builtins is not exploited on GIMPLE
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 5 Aug 2011 08:34:04 +0000
- Subject: [Bug tree-optimization/48092] associative property of builtins is not exploited on GIMPLE
- Auto-submitted: auto-generated
- References: <bug-48092-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48092
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.08.05 08:33:59
CC| |rguenth at gcc dot gnu.org
Component|rtl-optimization |tree-optimization
Summary|missing optimization |associative property of
|(associative property of |builtins is not exploited
|sqrt) |on GIMPLE
Ever Confirmed|0 |1
--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-08-05 08:33:59 UTC ---
The reason is we handle this only from the frontend folder which doesn't see
builtins when using std::sqrt. A C testcase like
double foo (double x, double y)
{
return __builtin_sqrt (x) * __builtin_sqrt (y);
}
is optimized.
For C++ (thus, optimizing the above when wrapping the sqrt inside an
inline function) these optimizations have to be replicated at the
GIMPLE level. Which today means in, for example, tree-ssa-forwprop.c.
Same issue for std::exp and other associative builtins.