diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-07-21 00:18:19 -0500 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-07-21 00:18:19 -0500 |
commit | a6654c08fde11890d621fa7831180d410054568a (patch) | |
tree | d38386a6802d56a41cfdc743202cf1ca3d558272 /gcc/tree-ssa-sccvn.cc | |
parent | 6894581ac453361e3fb4e1ffd54f9499acb87466 (diff) | |
download | gcc-a6654c08fde11890d621fa7831180d410054568a.zip gcc-a6654c08fde11890d621fa7831180d410054568a.tar.gz gcc-a6654c08fde11890d621fa7831180d410054568a.tar.bz2 |
sccvn: Correct the index of bias for IFN_LEN_STORE [PR110744]
Commit r14-2267-gb8806f6ffbe72e adjusts the arguments order
of LEN_STORE from {len,vector,bias} to {len,bias,vector},
in order to make them consistent with LEN_MASK_STORE and
MASK_STORE. But it missed to update the related handlings
in tree-ssa-sccvn.cc, it caused the failure shown in PR
110744. This patch is to fix the related handlings with
the correct index.
PR tree-optimization/110744
gcc/ChangeLog:
* tree-ssa-sccvn.cc (vn_reference_lookup_3): Correct the index of bias
operand for ifn IFN_LEN_STORE.
Diffstat (limited to 'gcc/tree-ssa-sccvn.cc')
-rw-r--r-- | gcc/tree-ssa-sccvn.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/tree-ssa-sccvn.cc b/gcc/tree-ssa-sccvn.cc index a0b98c1..ebe8006 100644 --- a/gcc/tree-ssa-sccvn.cc +++ b/gcc/tree-ssa-sccvn.cc @@ -3299,11 +3299,14 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *data_, return (void *)-1; break; case IFN_LEN_STORE: - len = gimple_call_arg (call, 2); - bias = gimple_call_arg (call, 4); - if (!tree_fits_uhwi_p (len) || !tree_fits_shwi_p (bias)) - return (void *)-1; - break; + { + int len_index = internal_fn_len_index (fn); + len = gimple_call_arg (call, len_index); + bias = gimple_call_arg (call, len_index + 1); + if (!tree_fits_uhwi_p (len) || !tree_fits_shwi_p (bias)) + return (void *) -1; + break; + } default: return (void *)-1; } |