[Bug tree-optimization/107407] [12/13 Regression] Wrong code at -Os on x86_64-linux-gnu since r12-383-g32955416d8040b1f

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Oct 26 08:03:29 GMT 2022


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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
   Last reconfirmed|                            |2022-10-26
   Target Milestone|---                         |13.0
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
            Summary|Wrong code at -Os on        |[12/13 Regression] Wrong
                   |x86_64-linux-gnu            |code at -Os on
                   |                            |x86_64-linux-gnu since
                   |                            |r12-383-g32955416d8040b1f

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
A bit reduced, started with r12-383-g32955416d8040b1f

int *a;
static int **b = &a;
int c[4];
int d;

int e(int);

static int f(char, int);

void g() { e((f(0, 0), 0)); }

int e(int h) { *a = 0; }

int f(char k, int j) {
  for (;;) {
    for (; k <= 3; k++) {
      *b = &c[k];
      for (; d <= 1; d++)
        *a = 3;
    }
    break;
  }
}
int main() {
  int i;
  g();
  if (c[0] != 3)
    __builtin_abort ();
}


More information about the Gcc-bugs mailing list