[Bug tree-optimization/98906] New: [8/9/10/11 Regression] Miscompiles code even at -O1

amonakov at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Jan 31 23:44:06 GMT 2021


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

            Bug ID: 98906
           Summary: [8/9/10/11 Regression] Miscompiles code even at -O1
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---

Created attachment 50097
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50097&action=edit
testcase

The attached testcase is clean w.r.t ASan and UBSan. At -O1+, 'main' is
miscompiled to a single basic block reporting an error on initial loop
iteration, since gcc-6, while -Og and '-O1 -fno-inline' yield expected code.

.optimized dump is wrong, so one of GIMPLE passes is the culprit, but a bit
hard to see which one exactly.


More information about the Gcc-bugs mailing list