[llvm-commits] [llvm] r45324 - /llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
Chris Lattner
sabre at nondot.org
Sat Dec 22 14:45:38 PST 2007
Author: lattner
Date: Sat Dec 22 16:45:38 2007
New Revision: 45324
URL: http://llvm.org/viewvc/llvm-project?rev=45324&view=rev
Log:
fix strict-aliasing violation
Modified:
llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp?rev=45324&r1=45323&r2=45324&view=diff
==============================================================================
--- llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/CellSPU/SPUISelDAGToDAG.cpp Sat Dec 22 16:45:38 2007
@@ -143,9 +143,7 @@
{
MVT::ValueType vt = FPN->getValueType(0);
if (vt == MVT::f32) {
- const APFloat &apf = FPN->getValueAPF();
- float fval = apf.convertToFloat();
- int val = *((int *) &fval);
+ int val = FloatToBits(FPN->getValueAPF().convertToFloat());
int sval = (int) ((val << 16) >> 16);
Imm = (short) val;
return val == sval;
More information about the llvm-commits
mailing list