summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorReed Kotler <rkotler@mips.com>2013-11-24 02:53:09 +0000
committerReed Kotler <rkotler@mips.com>2013-11-24 02:53:09 +0000
commitd3b28ebe03149641d8d126891b2b895c778022cb (patch)
treefbdeea3e139e3522a9aedba0d61aff57f8e3c188 /llvm/lib/Target
parent336fcd9c61e4cf845860d21ed12d631901b59581 (diff)
downloadbcm5719-llvm-d3b28ebe03149641d8d126891b2b895c778022cb.tar.gz
bcm5719-llvm-d3b28ebe03149641d8d126891b2b895c778022cb.zip
Fix a funny bug I introduced during conversion of ARM constant islands to Mips.
I had to move some code and I moved a declaration forward past it's first use in the function but by nutty coincidence there was another variable of the same name and type and with completely unrelated function that was declared globally in the class so no compilation error ensued. It required some unusual conditions for it to even matter. Caused test case casts.c in test-suite to fail during compilation with a duplicate symbol error. I would have noticed it during final code review for this port. llvm-svn: 195565
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mips/MipsConstantIslandPass.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
index 63d07f35478..f3a61e84cb7 100644
--- a/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
+++ b/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp
@@ -1275,6 +1275,10 @@ bool MipsConstantIslands::handleConstantPoolUser(unsigned CPUserIndex) {
// Decrement the old entry, and remove it if refcount becomes 0.
decrementCPEReferenceCount(CPI, CPEMI);
+ // No existing clone of this CPE is within range.
+ // We will be generating a new clone. Get a UID for it.
+ unsigned ID = createPICLabelUId();
+
// Now that we have an island to add the CPE to, clone the original CPE and
// add it to the island.
U.HighWaterMark = NewIsland;
@@ -1290,9 +1294,7 @@ bool MipsConstantIslands::handleConstantPoolUser(unsigned CPUserIndex) {
BBInfo[NewIsland->getNumber()].Size += Size;
adjustBBOffsetsAfter(llvm::prior(MachineFunction::iterator(NewIsland)));
- // No existing clone of this CPE is within range.
- // We will be generating a new clone. Get a UID for it.
- unsigned ID = createPICLabelUId();
+
// Finally, change the CPI in the instruction operand to be ID.
for (unsigned i = 0, e = UserMI->getNumOperands(); i != e; ++i)
OpenPOWER on IntegriCloud