public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/114075] New: [14 Regression] s390x miscompilation since r14-322
@ 2024-02-23 11:39 jakub at gcc dot gnu.org
  2024-02-23 11:39 ` [Bug tree-optimization/114075] " jakub at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2024-02-23 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114075
           Summary: [14 Regression] s390x miscompilation since r14-322
           Product: gcc
           Version: 14.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 r14-322-g821ef93976e750c118d42a2ad33b96dbd1b9f3a5 the following testcase
is miscompiled at -O2 -fopenmp-simd -march=z13 on s390x-linux:
typedef float V __attribute__((__vector_size__ (16)));

__attribute__((__always_inline__)) inline static float
foo (V a)
{
  float r = 0;
#pragma omp simd reduction(+:r)
  for (unsigned long i = 0; i < (sizeof (a) / sizeof (float)); i++)
    r += a[i];
  return r;
}

int
main ()
{
  static const struct { V a; float r; } t[] = {
    { (V) { -654.47f, -946.98f, -606.16f, 426.64f }, -1780.97f },
    { (V) { 663.94f, 660.23f, 682.64f, -644.47f }, 1362.34f },
    { (V) { -909.10f, 23.60f, -382.13f, -563.57f }, -1831.20f }
  };
  for (unsigned long i = 0; i < (sizeof (t) / sizeof (t[0])); i++)
    {
      float r = foo (t[i].a);
      if (r < t[i].r - 1.0f || r > t[i].r + 1.0f)
        __builtin_abort ();
    }
}

Before that change, all the 3 results were correct, now all of them are +-0.0f.

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

end of thread, other threads:[~2024-02-28 10:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-23 11:39 [Bug tree-optimization/114075] New: [14 Regression] s390x miscompilation since r14-322 jakub at gcc dot gnu.org
2024-02-23 11:39 ` [Bug tree-optimization/114075] " jakub at gcc dot gnu.org
2024-02-23 11:49 ` jakub at gcc dot gnu.org
2024-02-23 12:03 ` jakub at gcc dot gnu.org
2024-02-23 12:30 ` jakub at gcc dot gnu.org
2024-02-23 13:35 ` jchrist at linux dot ibm.com
2024-02-23 13:44 ` jchrist at linux dot ibm.com
2024-02-28 10:17 ` cvs-commit at gcc dot gnu.org
2024-02-28 10:50 ` cvs-commit at gcc dot gnu.org
2024-02-28 10:56 ` 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).