https://bugs.llvm.org/show_bug.cgi?id=44471

            Bug ID: 44471
           Summary: [SelectionDAG] OptLevelChanger::SavedFastISel
                    uninitialized variable warning
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedb...@nondot.org
          Reporter: llvm-...@redking.me.uk
                CC: llvm-bugs@lists.llvm.org, llvm-...@ndave.org,
                    paul_robin...@playstation.sony.com,
                    spatel+l...@rotateright.com

https://llvm.org/reports/scan-build/report-SelectionDAGISel.cpp-~OptLevelChanger-9-1.html#EndPath

OptLevelChanger(SelectionDAGISel &ISel,
                CodeGenOpt::Level NewOptLevel) : IS(ISel) {
  SavedOptLevel = IS.OptLevel;
  if (NewOptLevel == SavedOptLevel)
    return;
  IS.OptLevel = NewOptLevel;
  IS.TM.setOptLevel(NewOptLevel);
  DEBUG(dbgs() << "\nChanging optimization level for Function "
        << IS.MF->getFunction()->getName() << "\n");
  DEBUG(dbgs() << "\tBefore: -O" << SavedOptLevel
        << " ; After: -O" << NewOptLevel << "\n");
  SavedFastISel = IS.TM.Options.EnableFastISel;
  if (NewOptLevel == CodeGenOpt::None) {
    IS.TM.setFastISel(IS.TM.getO0WantsFastISel());
    DEBUG(dbgs() << "\tFastISel is "
          << (IS.TM.Options.EnableFastISel ? "enabled" : "disabled")
          << "\n");
  }
}

Static analyzer has noticed that SavedFastISel is not initialized if the
"NewOptLevel == SavedOptLevel" warl out occurs.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to