aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-data-ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-data-ref.c')
-rw-r--r--gcc/tree-data-ref.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 74f7614..ec80055 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -3872,6 +3872,8 @@ get_references_in_stmt (gimple *stmt, vec<data_ref_loc, va_heap> *references)
else if (stmt_code == GIMPLE_CALL)
{
unsigned i, n;
+ tree ptr, type;
+ unsigned int align;
ref.is_read = false;
if (gimple_call_internal_p (stmt))
@@ -3882,12 +3884,16 @@ get_references_in_stmt (gimple *stmt, vec<data_ref_loc, va_heap> *references)
break;
ref.is_read = true;
case IFN_MASK_STORE:
- ref.ref = fold_build2 (MEM_REF,
- ref.is_read
- ? TREE_TYPE (gimple_call_lhs (stmt))
- : TREE_TYPE (gimple_call_arg (stmt, 3)),
- gimple_call_arg (stmt, 0),
- gimple_call_arg (stmt, 1));
+ ptr = build_int_cst (TREE_TYPE (gimple_call_arg (stmt, 1)), 0);
+ align = tree_to_shwi (gimple_call_arg (stmt, 1));
+ if (ref.is_read)
+ type = TREE_TYPE (gimple_call_lhs (stmt));
+ else
+ type = TREE_TYPE (gimple_call_arg (stmt, 3));
+ if (TYPE_ALIGN (type) != align)
+ type = build_aligned_type (type, align);
+ ref.ref = fold_build2 (MEM_REF, type, gimple_call_arg (stmt, 0),
+ ptr);
references->safe_push (ref);
return false;
default: