public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95697] New: Failure to optimize float comparison of converted integer to integer comparison
@ 2020-06-16 15:17 gabravier at gmail dot com
2020-06-16 15:19 ` [Bug tree-optimization/95697] " gabravier at gmail dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: gabravier at gmail dot com @ 2020-06-16 15:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95697
Bug ID: 95697
Summary: Failure to optimize float comparison of converted
integer to integer comparison
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: gabravier at gmail dot com
Target Milestone: ---
bool f(int n)
{
return (float)n > 0.0;
}
This can be optimized to `return n > 0;`. This transformation is done by LLVM,
but not by GCC.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/95697] Failure to optimize float comparison of converted integer to integer comparison
2020-06-16 15:17 [Bug tree-optimization/95697] New: Failure to optimize float comparison of converted integer to integer comparison gabravier at gmail dot com
@ 2020-06-16 15:19 ` gabravier at gmail dot com
2020-06-16 16:53 ` joseph at codesourcery dot com
2021-08-07 19:48 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: gabravier at gmail dot com @ 2020-06-16 15:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95697
--- Comment #1 from Gabriel Ravier <gabravier at gmail dot com> ---
*** Bug 95698 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/95697] Failure to optimize float comparison of converted integer to integer comparison
2020-06-16 15:17 [Bug tree-optimization/95697] New: Failure to optimize float comparison of converted integer to integer comparison gabravier at gmail dot com
2020-06-16 15:19 ` [Bug tree-optimization/95697] " gabravier at gmail dot com
@ 2020-06-16 16:53 ` joseph at codesourcery dot com
2021-08-07 19:48 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: joseph at codesourcery dot com @ 2020-06-16 16:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95697
--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
See bug 60540, of which this is probably a duplicate, noting the issue
with losing "inexact" exceptions (and "overflow" for some types) and the
reference to bug 57371 for a more detailed discussion of the conditions
under which such optimizations are valid.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug tree-optimization/95697] Failure to optimize float comparison of converted integer to integer comparison
2020-06-16 15:17 [Bug tree-optimization/95697] New: Failure to optimize float comparison of converted integer to integer comparison gabravier at gmail dot com
2020-06-16 15:19 ` [Bug tree-optimization/95697] " gabravier at gmail dot com
2020-06-16 16:53 ` joseph at codesourcery dot com
@ 2021-08-07 19:48 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07 19:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95697
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |DUPLICATE
Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 60540.
*** This bug has been marked as a duplicate of bug 60540 ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-07 19:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 15:17 [Bug tree-optimization/95697] New: Failure to optimize float comparison of converted integer to integer comparison gabravier at gmail dot com
2020-06-16 15:19 ` [Bug tree-optimization/95697] " gabravier at gmail dot com
2020-06-16 16:53 ` joseph at codesourcery dot com
2021-08-07 19:48 ` pinskia at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).