public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/107972] New: backward propagation of finite property not performed
@ 2022-12-05 13:35 drepper.fsp+rhbz at gmail dot com
  2022-12-05 13:43 ` [Bug tree-optimization/107972] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: drepper.fsp+rhbz at gmail dot com @ 2022-12-05 13:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107972

            Bug ID: 107972
           Summary: backward propagation of finite property not performed
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: drepper.fsp+rhbz at gmail dot com
  Target Milestone: ---

Here is another example where with the help of the FP ranger capabilities the
compiler should generate better code than it does today (trunk):

double f(double a, double b)
{
  if (!__builtin_isfinite(a))
    return -1.0;

  double res = a + b;
  if (! __builtin_isfinite(res))
    __builtin_unreachable();
  return res;
}

The condition guaranteed by the __builtin_unreachable implies that neither a
nor b cannot be finite.  Hence the initial comparison can be elided.

The same is true for - and * and also for the first operand of /.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-02-14 21:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05 13:35 [Bug tree-optimization/107972] New: backward propagation of finite property not performed drepper.fsp+rhbz at gmail dot com
2022-12-05 13:43 ` [Bug tree-optimization/107972] " jakub at gcc dot gnu.org
2022-12-06  9:27 ` cvs-commit at gcc dot gnu.org
2022-12-06  9:57 ` jakub at gcc dot gnu.org
2022-12-07 15:31 ` amacleod at redhat dot com
2023-02-14 21:28 ` amacleod at redhat dot com

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).