Sync patch from openeuler/gcc - 20221201 (cherry picked from commit 5487e8942c694fd317f2cbf1662e9eaf33f2f612)
32 lines
1.0 KiB
Diff
32 lines
1.0 KiB
Diff
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
|
|
|