[PATCH] D19900: [scan-build] fix dead store warnings emitted on LLVM Hexagon code base
Apelete Seketeli via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 22:26:36 PDT 2016
apelete created this revision.
apelete added reviewers: kparzysz, colinl.
apelete added a subscriber: llvm-commits.
This patch fixes a logic error warning of the type "assigned value is
garbage or undefined" reported by Clang Static Analyzer on the
following file:
- lib/Target/Hexagon/HexagonOptAddrMode.cpp.
It also addresses dead store warnings of the type "dead assignment" on
the following files:
- lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp,
- lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp,
- lib/Target/Hexagon/HexagonFixupHwLoops.cpp,
- lib/Target/Hexagon/HexagonCommonGEP.cpp.
Signed-off-by: Apelete Seketeli <apelete at seketeli.net>
http://reviews.llvm.org/D19900
Files:
lib/Target/Hexagon/HexagonCommonGEP.cpp
lib/Target/Hexagon/HexagonFixupHwLoops.cpp
lib/Target/Hexagon/HexagonOptAddrMode.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
Index: lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp
@@ -180,7 +180,6 @@
if (MCS.size() == 1) { // case of one duplex
// copy the created duplex in the shuffler to the bundle
MCS.copyTo(MCB);
- doneShuffling = true;
return HexagonShuffler::SHUFFLE_SUCCESS;
}
// try shuffle with this duplex
Index: lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
===================================================================
--- lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
+++ lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
@@ -79,7 +79,6 @@
}
if (HexagonMCInstrInfo::isOuterLoop(*MI)) {
OS << Separator;
- Separator = " ";
MCInst ME;
ME.setOpcode(Hexagon::ENDLOOP1);
printInstruction(&ME, OS);
Index: lib/Target/Hexagon/HexagonOptAddrMode.cpp
===================================================================
--- lib/Target/Hexagon/HexagonOptAddrMode.cpp
+++ lib/Target/Hexagon/HexagonOptAddrMode.cpp
@@ -396,7 +396,7 @@
bool HexagonOptAddrMode::changeStore(MachineInstr *OldMI, MachineOperand ImmOp,
unsigned ImmOpNum) {
bool Changed = false;
- unsigned OpStart;
+ unsigned OpStart = 0;
unsigned OpEnd = OldMI->getNumOperands();
MachineBasicBlock *BB = OldMI->getParent();
auto UsePos = MachineBasicBlock::iterator(OldMI);
Index: lib/Target/Hexagon/HexagonFixupHwLoops.cpp
===================================================================
--- lib/Target/Hexagon/HexagonFixupHwLoops.cpp
+++ lib/Target/Hexagon/HexagonFixupHwLoops.cpp
@@ -130,7 +130,6 @@
// Second pass - check each loop instruction to see if it needs to be
// converted.
- InstOffset = 0;
bool Changed = false;
for (MachineBasicBlock &MBB : MF) {
InstOffset = BlockToInstOffset[&MBB];
Index: lib/Target/Hexagon/HexagonCommonGEP.cpp
===================================================================
--- lib/Target/Hexagon/HexagonCommonGEP.cpp
+++ lib/Target/Hexagon/HexagonCommonGEP.cpp
@@ -212,7 +212,6 @@
if (Comma)
OS << ',';
OS << "used";
- Comma = true;
}
OS << "} ";
if (GN.Flags & GepNode::Root)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19900.56093.patch
Type: text/x-patch
Size: 2389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160504/b6a9d365/attachment.bin>
More information about the llvm-commits
mailing list