[Bug tree-optimization/101062] [10/11/12 Regression] wrong code with "-O2 -fno-toplevel-reorder -frename-registers"

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jun 14 18:04:08 GMT 2021


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Target Milestone|---                         |10.4
                 CC|                            |jakub at gcc dot gnu.org
   Last reconfirmed|                            |2021-06-14
            Summary|wrong code with "-O2        |[10/11/12 Regression] wrong
                   |-fno-toplevel-reorder       |code with "-O2
                   |-frename-registers"         |-fno-toplevel-reorder
                   |                            |-frename-registers"

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r10-3542-g0b92cf305dcf34387a8e2564e55ca8948df3b47a
so likely latent before.

Slightly adjusted testcase:
/* { dg-do run } */
/* { dg-options "-O2 -fno-toplevel-reorder -frename-registers" } */

union U { signed b : 5; };
int c;
volatile union U d[7] = {{8}};
short e = 1;

__attribute__((noipa)) void
foo ()
{
  for (c = 5; c; c--)
    e = d[6].b = 0;
}

int
main ()
{
  foo ();
  if (e != 0)
    __builtin_abort ();
  return 0;
}


More information about the Gcc-bugs mailing list