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

            Bug ID: 80591
           Summary: [7/8 Regression] AArch64 kernel miscompilation
                    starting with r246809
           Product: gcc
           Version: 7.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: ---

struct S {
 char p[6300];
 int s;
};

static inline __attribute__((always_inline)) struct S *
foo (void)
{
  unsigned long sp;
  asm ("" : "=r" (sp));
  return (struct S *) sp;
}

void
bar (void)
{
  foo ()->s++;
}

is miscompiled starting with r246809 at -O2 (tried cross to aarch64-linux as
well as x86_64-linux native), the increment is optimized away.

Reply via email to