[llvm-commits] fix for !__builtin_isunordered(X, Y);

Chris Lattner clattner at apple.com
Thu Dec 14 22:40:41 PST 2006


This fixes a bug compiling:

int test2(float X, float Y) {
   return !__builtin_isunordered(X, Y);
}

because we checked the wrong 'opcode', we compiled it to the same  
code as:

int test1(float X, float Y) {
   return __builtin_isunordered(X, Y);
}

Reid/Sheng, please make sure that the corresponding patch makes it  
into your llvm-gcc changes, thx.

-Chris

Index: llvm-convert.cpp
===================================================================
--- llvm-convert.cpp    (revision 121370)
+++ llvm-convert.cpp    (working copy)
@@ -2329,7 +2329,7 @@
        Result = IsUnord;

      // If this is an ORDERED_EXPR, invert the result of the  
isunordered call.
-    if (Opc == ORDERED_EXPR)
+    if (TREE_CODE(exp) == ORDERED_EXPR)
        Result = BinaryOperator::createNot(Result, "tmp", CurBB);
    }





More information about the llvm-commits mailing list