[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-31 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #14 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:e02c9d9116f243643c0daba8dbcc5d1795c827c3 commit r13-6956-ge02c9d9116f243643c0daba8dbcc5d1795c827c3 Author: Jakub Jelinek Date:

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 Jakub Jelinek changed: What|Removed |Added Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #12 from Jakub Jelinek --- WIP which still doesn't work: --- gcc/value-query.cc.jj 2023-03-23 15:25:47.069740988 +0100 +++ gcc/value-query.cc 2023-03-30 14:56:58.809298424 +0200 @@ -230,9 +230,11 @@ range_query::get_tree_range

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-30 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #11 from Jakub Jelinek --- (In reply to Aldy Hernandez from comment #9) > It looks like what we want for this test is actually !isgreaterequal() not > isless(), since we want to exclude the possibility of a NAN. Like this: > >

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-29 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 Aldy Hernandez changed: What|Removed |Added CC||llvm at rifkin dot dev --- Comment #10

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2023-03-29 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #9 from Aldy Hernandez --- It looks like what we want for this test is actually !isgreaterequal() not isless(), since we want to exclude the possibility of a NAN. Like this: float test (float x) { if (!__builtin_isgreaterequal

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2022-09-03 Thread law at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #8 from Jeffrey A. Law --- First, there's magic bits which turn a standard sqrt call into something like if (exceptional condition) call libm's sqrt else use hardware sqrt The primary goal is to get errno set properly for those

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2022-09-03 Thread aldyh at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 Aldy Hernandez changed: What|Removed |Added CC||aldyh at gcc dot gnu.org,

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #6 from rguenther at suse dot de --- On Thu, 5 Sep 2019, lisyarus at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 > > --- Comment #5 from Nikita Lisitsa --- > Oh, thank you a lot! Indeed, this version

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread lisyarus at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #5 from Nikita Lisitsa --- Oh, thank you a lot! Indeed, this version compiles to just mulss & sqrtss float test (float x) { float y = x*x; if (std::isless(y, 0.f)) __builtin_unreachable(); return std::sqrt(y); }

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-05 Thread rguenther at suse dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #4 from rguenther at suse dot de --- On Wed, 4 Sep 2019, lisyarus at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 > > --- Comment #2 from Nikita Lisitsa --- > If by 'isless(y, 0.0)' you mean 'y < 0.f',

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-04 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #3 from Marc Glisse --- (In reply to Richard Biener from comment #1) > for y >= 0.0 the result is unspecified? NaN >= 0.0 is false, but even if it was unspecified, the implication would still be true. (In reply to Nikita Lisitsa

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-04 Thread lisyarus at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 --- Comment #2 from Nikita Lisitsa --- If by 'isless(y, 0.0)' you mean 'y < 0.f', then no, it doesn't change anything, it produces the same 'ucomiss ... call sqrtf' boilerplate. May I have misunderstood you? By the way, what about '#pragma GCC

[Bug tree-optimization/91645] Missed optimization with sqrt(x*x)

2019-09-04 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91645 Richard Biener changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed|