aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorFeng Xue <fxue@os.amperecomputing.com>2024-06-14 15:49:23 +0800
committerFeng Xue <fxue@os.amperecomputing.com>2024-07-29 14:50:00 +0800
commit49339d8b7e03a7ba0d4a5e118af993f175485b41 (patch)
tree3b842cc37b35a6267ce83c5d87cd475dee7c8a9f /gcc
parent16daeb262af4566e665a941368cb15bc2cba3f07 (diff)
downloadgcc-49339d8b7e03a7ba0d4a5e118af993f175485b41.zip
gcc-49339d8b7e03a7ba0d4a5e118af993f175485b41.tar.gz
gcc-49339d8b7e03a7ba0d4a5e118af993f175485b41.tar.bz2
vect: Fix single_imm_use in tree_vect_patterns
Since pattern statement coexists with normal statements in a way that it is not linked into function body, we should not invoke utility procedures that depends on def/use graph on pattern statement, such as counting uses of a pseudo value defined by a pattern statement. This patch is to fix a bug of this type in vect pattern formation. 2024-06-14 Feng Xue <fxue@os.amperecomputing.com> gcc/ * tree-vect-patterns.cc (vect_recog_bitfield_ref_pattern): Only call single_imm_use if statement is not generated from pattern recognition.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree-vect-patterns.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc
index 5fbd1a4..4674a16 100644
--- a/gcc/tree-vect-patterns.cc
+++ b/gcc/tree-vect-patterns.cc
@@ -2702,7 +2702,8 @@ vect_recog_bitfield_ref_pattern (vec_info *vinfo, stmt_vec_info stmt_info,
/* If the only use of the result of this BIT_FIELD_REF + CONVERT is a
PLUS_EXPR then do the shift last as some targets can combine the shift and
add into a single instruction. */
- if (lhs && single_imm_use (lhs, &use_p, &use_stmt))
+ if (lhs && !is_pattern_stmt_p (stmt_info)
+ && single_imm_use (lhs, &use_p, &use_stmt))
{
if (gimple_code (use_stmt) == GIMPLE_ASSIGN
&& gimple_assign_rhs_code (use_stmt) == PLUS_EXPR)