+2015-05-22 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/63387
+ * match.pd ((X /[ex] A) * A -> X): Remove unnecessary condition.
+ ((x ord x) & (y ord y) -> (x ord y),
+ (x ord x) & (x ord y) -> (x ord y)): New simplifications.
+ * fold-const.c (tree_unary_nonnegative_warnv_p) <ABS_EXPR>: Handle
+ vectors like scalars.
+
2015-05-22 Marc Glisse <marc.glisse@inria.fr>
* convert.c (convert_to_integer, convert_to_vector): Include the
case ABS_EXPR:
/* We can't return 1 if flag_wrapv is set because
ABS_EXPR<INT_MIN> = INT_MIN. */
- if (!INTEGRAL_TYPE_P (type))
+ if (!ANY_INTEGRAL_TYPE_P (type))
return true;
if (TYPE_OVERFLOW_UNDEFINED (type))
{
(simplify
(mult (convert? (exact_div @0 @1)) @1)
/* Look through a sign-changing conversion. */
- (if (TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (type))
- (convert @0)))
+ (convert @0))
/* Canonicalization of binary operations. */
(bit_ior (unordered @0 @0) (unordered @1 @1))
(if (types_match (@0, @1))
(unordered @0 @1)))
+(simplify
+ (bit_and (ordered @0 @0) (ordered @1 @1))
+ (if (types_match (@0, @1))
+ (ordered @0 @1)))
(simplify
(bit_ior:c (unordered @0 @0) (unordered:c@2 @0 @1))
@2)
+(simplify
+ (bit_and:c (ordered @0 @0) (ordered:c@2 @0 @1))
+ @2)
/* Simplification of math builtins. */
+2015-05-22 Marc Glisse <marc.glisse@inria.fr>
+
+ PR tree-optimization/63387
+ * gcc.dg/pr63387-2.c: New testcase.
+
2015-05-22 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/simd-1.c: Update to the new message.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fdump-tree-optimized" } */
+
+int f(double aaa, double bbb){
+ int xa = !__builtin_isunordered(aaa, aaa);
+ int xb = !__builtin_isunordered(bbb, bbb);
+ return xa & xb;
+}
+
+int g(double aaa, double bbb){
+ int xa = !__builtin_isunordered(aaa, bbb);
+ int xb = !__builtin_isunordered(bbb, bbb);
+ return xa & xb;
+}
+
+int h(double ccc, float ddd){
+ int xc = !__builtin_isunordered(ccc, ccc);
+ int xd = !__builtin_isunordered(ddd, ddd);
+ return xc & xd;
+}
+
+/* { dg-final { scan-tree-dump-not "aaa\[^\n\r\]* ord aaa" "optimized" } } */
+/* { dg-final { scan-tree-dump-not "bbb\[^\n\r\]* ord bbb" "optimized" } } */
+/* { dg-final { scan-tree-dump-times "aaa\[^\n\r\]* ord bbb" 2 "optimized" } } */
+/* { dg-final { scan-tree-dump-not "ccc\[^\n\r\]* ord ddd" "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */