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

            Bug ID: 107569
           Summary: [13 Regression] Failure to optimize std::isfinite
                    since r13-3596
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Since r13-3596-ge7310e24b1c0ca67b1bb507c1330b2bf39e59e32
we don't optimize foo in 1 into return 1:

namespace std
{
  constexpr bool isfinite (float x) { return __builtin_isfinite (x); }
  constexpr bool isfinite (double x) { return __builtin_isfinite (x); }
  constexpr bool isfinite (long double x) { return __builtin_isfinite (x); }
}

bool
foo (double x)
{
  if (!std::isfinite (x))
    __builtin_unreachable ();

  return std::isfinite (x);
}

bool
bar (double x)
{
  [[assume (std::isfinite (x))]];
  return std::isfinite (x);
}

While bar hasn't been optimized before, it would be nice to make it working
too.

Reply via email to