[Bug tree-optimization/103063] New: Wrong code while using -O3

stefansf at linux dot ibm.com gcc-bugzilla@gcc.gnu.org
Wed Nov 3 16:04:47 GMT 2021


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

            Bug ID: 103063
           Summary: Wrong code while using -O3
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stefansf at linux dot ibm.com
  Target Milestone: ---

int a = 0;
unsigned char b = 0;

int main() {
  a - 6;
  for (; a >= -13; a = a - 8)
    while((unsigned char)(b-- * 6))
      ;
  if (b != 127)
    __builtin_abort();
  return 0;
}

Running the example while compiled with -O{0,1,2} works fine whereas it fails
with -O{3,fast} using gcc-12-4860-g73658e70d9e. Couldn't find a good commit so
far. Fails on IBM Z as well as x64.

Still not sure where it fails. ifcvt looks good to me.


More information about the Gcc-bugs mailing list