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

            Bug ID: 100182
           Summary: [8/9/10/11/12 Regression] Miscompilation of
                    atomic_float/1.cc on i686
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Since r7-1112-gbeed3701c796842abbfb27d7484b35bd82818740
the following testcase distilled from 29_atomics/atomic_float/1.cc with -O2
-march=i686 -m32 aborts on i686-linux:
struct __attribute__((aligned (8))) S { double _M_fp; };
union U { double d; unsigned long long int l; };

__attribute__((noipa)) void
foo (void)
{
  struct S a0, a1;
  union U u;
  double d0, d1;
  a0._M_fp = 0.0;
  a1._M_fp = 1.0;
  __atomic_store_8 (&a0._M_fp, __atomic_load_8 (&a1._M_fp, __ATOMIC_SEQ_CST),
__ATOMIC_SEQ_CST);
  u.l = __atomic_load_8 (&a0._M_fp, __ATOMIC_SEQ_CST);
  d0 = u.d;
  u.l = __atomic_load_8 (&a1._M_fp, __ATOMIC_SEQ_CST);
  d1 = u.d;
  if (d0 != d1)
    __builtin_abort ();
}

int
main ()
{
  foo ();
  return 0;
}

Reply via email to