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

            Bug ID: 97851
           Summary: aarch64: Wrong code with -Os -fmodulo-sched since
                    r7-879-g43c0068e60
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: acoplan at gcc dot gnu.org
  Target Milestone: ---

AArch64 GCC miscompiles the following testcase:

int a, b, c;
short d;
void e(void) {
  unsigned f = 0;
  for (; f <= 2; f++) {
    int g[1];
    int h = (long)g;
    c = 0;
    for (; c < 10; c++)
      g[0] = a = 0;
    for (; a <= 2; a++)
      b = d;
  }
}
int main(void) {
  e();
  if (a != 3)
    __builtin_abort();
}

with -Os -fmodulo-sched since r7-879-g43c0068e60ad1518cc6196eeac51eb811fe62f8f.

It seems likely that this is just a latent bug revealed by the above revision,
however (hence tagging as rtl-optimization). Possibly related to PR97440 or
PR97421.

Reply via email to