[llvm-bugs] [Bug 32265] New: llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp: PVS-Studio: V501

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Mar 14 07:56:08 PDT 2017


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

            Bug ID: 32265
           Summary: llvm/lib/Target/Hexagon/HexagonEarlyIfConv.cpp:
                    PVS-Studio: V501
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: Hexagon
          Assignee: unassignedbugs at nondot.org
          Reporter: razmyslov at viva64.com
                CC: llvm-bugs at lists.llvm.org

We have found a bug using PVS-Studio tool: PVS-Studio is a static code analyzer
for C, C++ and C#: https://www.viva64.com/en/pvs-studio/

Analyzer warning: V501 There are identical sub-expressions 'RA.getSubReg() !=
0' to the left and to the right of the '||' operator. hexagonearlyifconv.cpp
485

unsigned HexagonEarlyIfConversion::computePhiCost(....) const {
  ....
  const MachineOperand &RA = MI.getOperand(1);
  const MachineOperand &RB = MI.getOperand(3);
  assert(RA.isReg() && RB.isReg());
  // Must have a MUX if the phi uses a subregister.
  if (RA.getSubReg() != 0 || RA.getSubReg() != 0) { // <= RB ???
    Cost++;
    continue;
  }
  ....
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20170314/97c15bed/attachment-0001.html>


More information about the llvm-bugs mailing list