<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [SelectionDAG] OptLevelChanger::SavedFastISel uninitialized variable warning"
   href="https://bugs.llvm.org/show_bug.cgi?id=44471">44471</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[SelectionDAG] OptLevelChanger::SavedFastISel uninitialized variable warning
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>llvm-dev@redking.me.uk
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, llvm-dev@ndave.org, paul_robinson@playstation.sony.com, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre><a href="https://llvm.org/reports/scan-build/report-SelectionDAGISel.cpp-~OptLevelChanger-9-1.html#EndPath">https://llvm.org/reports/scan-build/report-SelectionDAGISel.cpp-~OptLevelChanger-9-1.html#EndPath</a>

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.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>