summaryrefslogtreecommitdiff
path: root/0071-PHIOPT-Disable-the-match-A-CST1-0-when-the-CST1-is-n.patch
blob: 18c2e3bafca773de276e2490932c08d3f777227a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From b57c55b282e7a9a7b2cc0d3843e58fd7998685e6 Mon Sep 17 00:00:00 2001
From: zhongyunde <zhongyunde@huawei.com>
Date: Fri, 4 Nov 2022 23:19:44 +0800
Subject: [PATCH 23/35] [PHIOPT] Disable the match A?CST1:0 when the CST1 is
 negitive value

Fix the regression of gcc.target/aarch64/sve/vcond_3.c

gcc:
        * match.pd (A?CST1:CST2): Disable the simplifcations A? (-CST1):0
---
 gcc/match.pd | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/match.pd b/gcc/match.pd
index 79a0228d2..fc1a34dd3 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3347,7 +3347,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
     (if (integer_onep (@1))
      (convert (convert:boolean_type_node @0)))
     /* a ? powerof2cst : 0 -> a << (log2(powerof2cst)) */
-    (if (INTEGRAL_TYPE_P (type) && integer_pow2p (@1))
+    (if (INTEGRAL_TYPE_P (type) && TYPE_UNSIGNED (TREE_TYPE (@1))
+         && integer_pow2p (@1))
      (with {
        tree shift = build_int_cst (integer_type_node, tree_log2 (@1));
       }
-- 
2.27.0.windows.1