public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/109386] New: [13 Regression] Frange value relation related miscompilation
@ 2023-04-03  8:00 jakub at gcc dot gnu.org
  2023-04-03  8:00 ` [Bug tree-optimization/109386] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-04-03  8:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109386
           Summary: [13 Regression] Frange value relation related
                    miscompilation
           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: ---

I've totally missed a regression caused by my recent frange improvements (most
likely
r13-6967-g5fe05ffefd21c4fa):
+FAIL: libphobos.phobos/std/math/algebraic.d execution test
+FAIL: libphobos.phobos_shared/std/math/algebraic.d execution test

Reduced testcase in C:
static inline float
foo (float x, float y)
{
  float u = __builtin_fabsf (x);
  float v = __builtin_fabsf (y);
  if (!(u >= v))
    {
      v = u;
      u = __builtin_fabsf (y);
      if (__builtin_isinf (u)) return u;
      if (__builtin_isinf (v)) return v;
    }
  return 42.0f;
}

int
main ()
{
  if (!__builtin_isinf (foo (__builtin_inff (), __builtin_nanf (""))))
    __builtin_abort ();
}
for -O2.
I believe the bug is that (as discussed earlier) we don't implement the full
set of VREL_* relations for the case where NAN may be seen and in this case
register VREL_LT for the if block, which is wrong, the inverse of VREL_GE is
VREL_UNLT which we don't currently have.

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

end of thread, other threads:[~2023-04-04 14:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03  8:00 [Bug tree-optimization/109386] New: [13 Regression] Frange value relation related miscompilation jakub at gcc dot gnu.org
2023-04-03  8:00 ` [Bug tree-optimization/109386] " jakub at gcc dot gnu.org
2023-04-03  8:48 ` jakub at gcc dot gnu.org
2023-04-03 10:21 ` jakub at gcc dot gnu.org
2023-04-03 11:00 ` marxin at gcc dot gnu.org
2023-04-03 12:16 ` jakub at gcc dot gnu.org
2023-04-04 14:20 ` cvs-commit at gcc dot gnu.org
2023-04-04 14:22 ` jakub 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).