Lowering constant pool entries on ppc exposed a bug in the recently added
authorNate Begeman <natebegeman@mac.com>
Tue, 13 Dec 2005 03:03:23 +0000 (03:03 +0000)
committerNate Begeman <natebegeman@mac.com>
Tue, 13 Dec 2005 03:03:23 +0000 (03:03 +0000)
ConstantVec legalizing code, which would return constantpool nodes that
were not of the target's pointer type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24691 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp

index 6896fb39e261b0c7600719b0e928f0632cdef236..15376216a51be4694c4b27c5f951871e069f7cb7 100644 (file)
@@ -714,7 +714,7 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
                                        cast<ConstantSDNode>(OpN)->getValue()));
     }
     Constant *CP = ConstantPacked::get(CV);
-    SDOperand CPIdx = DAG.getConstantPool(CP, Node->getValueType(0));
+    SDOperand CPIdx = LegalizeOp(DAG.getConstantPool(CP, TLI.getPointerTy()));
     Result = DAG.getLoad(VT, DAG.getEntryNode(), CPIdx, DAG.getSrcValue(NULL));
     break;
   }