diff options
Diffstat (limited to 'gcc/internal-fn.c')
-rw-r--r-- | gcc/internal-fn.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 88adaea4c86..da205c9d68a 100644 --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -2444,11 +2444,14 @@ expand_call_mem_ref (tree type, gcall *stmt, int index) && types_compatible_p (TREE_TYPE (mem), type)) { tree offset = TMR_OFFSET (mem); - if (alias_ptr_type != TREE_TYPE (offset) || !integer_zerop (offset)) + if (type != TREE_TYPE (mem) + || alias_ptr_type != TREE_TYPE (offset) + || !integer_zerop (offset)) { mem = copy_node (mem); TMR_OFFSET (mem) = wide_int_to_tree (alias_ptr_type, wi::to_poly_wide (offset)); + TREE_TYPE (mem) = type; } return mem; } |