diff options
author | Peter Bergner <bergner@linux.ibm.com> | 2019-10-24 19:17:39 +0000 |
---|---|---|
committer | Peter Bergner <bergner@linux.ibm.com> | 2019-10-24 19:17:39 +0000 |
commit | b3875f87fbe002ad43f35ba5cc16efc80f809883 (patch) | |
tree | ecb74be9e46fcebac6dcaa2e911693b9b70891bf /gcc/config/s390/s390-c.c | |
parent | d3f50b70a40ea3518d7e386300c4e26e19924ad5 (diff) | |
parent | d844b1d496ef9602a263834327aa73f72663cb6b (diff) |
Merge up to 277354.
* REVISION: Update subversion id.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/ibm/gcc-8-branch@277422 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390/s390-c.c')
-rw-r--r-- | gcc/config/s390/s390-c.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/gcc/config/s390/s390-c.c b/gcc/config/s390/s390-c.c index 4a72d499cee..8fb46b03af3 100644 --- a/gcc/config/s390/s390-c.c +++ b/gcc/config/s390/s390-c.c @@ -477,16 +477,30 @@ s390_expand_overloaded_builtin (location_t loc, case S390_OVERLOADED_BUILTIN_s390_vec_xl: case S390_OVERLOADED_BUILTIN_s390_vec_xld2: case S390_OVERLOADED_BUILTIN_s390_vec_xlw4: - return build2 (MEM_REF, return_type, - fold_build_pointer_plus ((*arglist)[1], (*arglist)[0]), - build_int_cst (TREE_TYPE ((*arglist)[1]), 0)); + { + /* Build a vector type with the alignment of the source + location in order to enable correct alignment hints to be + generated for vl. */ + tree mem_type = build_aligned_type (return_type, + TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[1])))); + return build2 (MEM_REF, mem_type, + fold_build_pointer_plus ((*arglist)[1], (*arglist)[0]), + build_int_cst (TREE_TYPE ((*arglist)[1]), 0)); + } case S390_OVERLOADED_BUILTIN_s390_vec_xst: case S390_OVERLOADED_BUILTIN_s390_vec_xstd2: case S390_OVERLOADED_BUILTIN_s390_vec_xstw4: - return build2 (MODIFY_EXPR, TREE_TYPE((*arglist)[0]), - build1 (INDIRECT_REF, TREE_TYPE((*arglist)[0]), - fold_build_pointer_plus ((*arglist)[2], (*arglist)[1])), - (*arglist)[0]); + { + /* Build a vector type with the alignment of the target + location in order to enable correct alignment hints to be + generated for vst. */ + tree mem_type = build_aligned_type (TREE_TYPE((*arglist)[0]), + TYPE_ALIGN (TREE_TYPE (TREE_TYPE ((*arglist)[2])))); + return build2 (MODIFY_EXPR, mem_type, + build1 (INDIRECT_REF, mem_type, + fold_build_pointer_plus ((*arglist)[2], (*arglist)[1])), + (*arglist)[0]); + } case S390_OVERLOADED_BUILTIN_s390_vec_load_pair: return build_constructor_va (return_type, 2, NULL_TREE, (*arglist)[0], |