aboutsummaryrefslogtreecommitdiff
path: root/gcc/lra-constraints.c
diff options
context:
space:
mode:
authorLi Jia He <helijia@linux.ibm.com>2019-02-20 02:35:39 +0000
committerLi Jia He <helijia@gcc.gnu.org>2019-02-20 02:35:39 +0000
commite86ae7bab3f01c7d35d36fc19c2a39a48d01b64c (patch)
tree16f96736c8b6aa41169c68b90183299498ed9670 /gcc/lra-constraints.c
parent9d35a27a8353b57ed11fa1cb7d747edf1c4faa01 (diff)
downloadgcc-e86ae7bab3f01c7d35d36fc19c2a39a48d01b64c.zip
gcc-e86ae7bab3f01c7d35d36fc19c2a39a48d01b64c.tar.gz
gcc-e86ae7bab3f01c7d35d36fc19c2a39a48d01b64c.tar.bz2
[rs6000] fix PR 88100, range check for vec_splat_{su}{8,16,32}
GCC revision 259524 implemented range check for the vec_splat_{su}{8,16,32} builtins. However, as a consequence of the implementation, the range check is not done correctly for the expected vspltis[bhw] instructions.  The result is that we may not get a valid error message if the valid range of the data is exceeded. Although the input of the function prototype of vec_splat_{su}{8,16,32} is const int, the actual data usage range is limited to the data range of 5 bits signed. We should limit the int_cst.val[0] data to the 5 bit signed data range without any modification in the input arg0 parameter. However, the sext_hwi function intercepts the data of TREE_INT_CST_LOW (arg0) as size bits in the sext_hwi (TREE_INT_CST_LOW (arg0), size) statement. This will cause some of the excess data to fall within the range of 5 bits signed, so that the correct diagnostic information cannot be generated, we need to remove the sext_hwi to ensure that the input data has not been modified. This patch fix range check for the vec_splat_s[8,16,32] builtins. The argument must be a 5-bit const int as specified for the vspltis[bhw] instructions. for gcc/ChangeLog PR target/88100 * gcc/config/rs6000/rs6000.c (rs6000_gimple_fold_builtin) <case ALTIVEC_BUILTIN_VSPLTISB, ALTIVEC_BUILTIN_VSPLTISH, ALTIVEC_BUILTIN_VSPLTISW>: Don't convert the operand before range checking it. for gcc/testsuite/ChangeLog PR target/88100 * gcc/testsuite/gcc.target/powerpc/pr88100.c: New testcase. From-SVN: r269033
Diffstat (limited to 'gcc/lra-constraints.c')
0 files changed, 0 insertions, 0 deletions