diff options
author | Martin Liska <mliska@suse.cz> | 2021-12-01 13:30:25 +0100 |
---|---|---|
committer | Martin Liska <mliska@suse.cz> | 2021-12-01 13:30:25 +0100 |
commit | 4cba2fa027afd5f815bd9bf3965afe1972c7387c (patch) | |
tree | efa05b4ca35e93c65eb1a2585d5ad3dd2dd3db32 /gcc/tree-vect-patterns.c | |
parent | 789b80d1fbd0b1d516b389bf11b5c70aa4d1088b (diff) | |
parent | d376b73aa12d183e3040456c7641fb74500d0727 (diff) | |
download | gcc-4cba2fa027afd5f815bd9bf3965afe1972c7387c.zip gcc-4cba2fa027afd5f815bd9bf3965afe1972c7387c.tar.gz gcc-4cba2fa027afd5f815bd9bf3965afe1972c7387c.tar.bz2 |
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/tree-vect-patterns.c')
-rw-r--r-- | gcc/tree-vect-patterns.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 854cbcf..26421ee 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -5594,8 +5594,10 @@ vect_mark_pattern_stmts (vec_info *vinfo, /* Transfer reduction path info to the pattern. */ if (STMT_VINFO_REDUC_IDX (orig_stmt_info_saved) != -1) { - tree lookfor = gimple_op (orig_stmt_info_saved->stmt, - 1 + STMT_VINFO_REDUC_IDX (orig_stmt_info)); + gimple_match_op op; + if (!gimple_extract_op (orig_stmt_info_saved->stmt, &op)) + gcc_unreachable (); + tree lookfor = op.ops[STMT_VINFO_REDUC_IDX (orig_stmt_info)]; /* Search the pattern def sequence and the main pattern stmt. Note we may have inserted all into a containing pattern def sequence so the following is a bit awkward. */ @@ -5615,14 +5617,15 @@ vect_mark_pattern_stmts (vec_info *vinfo, do { bool found = false; - for (unsigned i = 1; i < gimple_num_ops (s); ++i) - if (gimple_op (s, i) == lookfor) - { - STMT_VINFO_REDUC_IDX (vinfo->lookup_stmt (s)) = i - 1; - lookfor = gimple_get_lhs (s); - found = true; - break; - } + if (gimple_extract_op (s, &op)) + for (unsigned i = 0; i < op.num_ops; ++i) + if (op.ops[i] == lookfor) + { + STMT_VINFO_REDUC_IDX (vinfo->lookup_stmt (s)) = i; + lookfor = gimple_get_lhs (s); + found = true; + break; + } if (s == pattern_stmt) { if (!found && dump_enabled_p ()) |