gimple-fold: Refine gimple_fold_partial_load_store_mem_ref [PR107412]
authorKewen Lin <linkw@linux.ibm.com>
Mon, 5 Dec 2022 05:27:08 +0000 (23:27 -0600)
committerKewen Lin <linkw@linux.ibm.com>
Mon, 5 Dec 2022 05:27:08 +0000 (23:27 -0600)
commit380d62c14c99d8df13b7a86660e7ee67d01ad827
tree306f2a941297b5561bf14eaff06a8f06a9a55285
parent102f3cef568e685d5f65a712f75e0628e3c1733c
gimple-fold: Refine gimple_fold_partial_load_store_mem_ref [PR107412]

Following Richard's review comments, this patch is to use
untruncated type for the length used for IFN_LEN_{LOAD,STORE}
instead of "unsigned int" for better robustness.  It also
avoid to use to_constant and tree arithmetic for subtraction.

Co-authored-by: Richard Sandiford <richard.sandiford@arm.com>
PR tree-optimization/107412

gcc/ChangeLog:

* gimple-fold.cc (gimple_fold_partial_load_store_mem_ref): Use
untruncated type for the length, and avoid to_constant and tree
arithmetic for subtraction.
gcc/gimple-fold.cc