This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/83352] Missed optimization in math expression: sqrt(sqrt(a)) == pow(a, 1/4)
- From: "zamazan4ik at tut dot by" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 01 Nov 2018 07:33:20 +0000
- Subject: [Bug tree-optimization/83352] Missed optimization in math expression: sqrt(sqrt(a)) == pow(a, 1/4)
- Auto-submitted: auto-generated
- References: <bug-83352-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83352
--- Comment #2 from Alexander Zaitsev <zamazan4ik at tut dot by> ---
What about longer sqrt functions call?
gcc(trunk) -O3 -ffast-math:
double test(double a)
{
return sqrt(sqrt(sqrt(sqrt(sqrt(a)))));
}
test(double):
andpd xmm0, XMMWORD PTR .LC0[rip]
sqrtsd xmm0, xmm0
sqrtsd xmm0, xmm0
sqrtsd xmm0, xmm0
sqrtsd xmm0, xmm0
sqrtsd xmm0, xmm0
ret
Don't see any optimizations on godbolt