This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/83352] Missed optimization in math expression: sqrt(sqrt(a)) == pow(a, 1/4)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]