summaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index d26e03b5095..2381ac34d1e 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -1036,7 +1036,7 @@ build_ref_for_offset_1 (tree *res, tree type, HOST_WIDE_INT offset,
HOST_WIDE_INT el_size;
if (offset == 0 && exp_type
- && useless_type_conversion_p (exp_type, type))
+ && types_compatible_p (exp_type, type))
return true;
switch (TREE_CODE (type))
@@ -1760,7 +1760,6 @@ generate_subtree_copies (struct access *access, tree agg,
insert_after ? GSI_NEW_STMT
: GSI_SAME_STMT);
stmt = gimple_build_assign (expr, repl);
- sra_stats.subtree_copies++;
}
if (insert_after)
@@ -1768,6 +1767,7 @@ generate_subtree_copies (struct access *access, tree agg,
else
gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
update_stmt (stmt);
+ sra_stats.subtree_copies++;
}
if (access->first_child)
@@ -1908,7 +1908,8 @@ sra_modify_expr (tree *expr, gimple_stmt_iterator *gsi, bool write,
&& host_integerp (TREE_OPERAND (bfr, 2), 1))
{
chunk_size = tree_low_cst (TREE_OPERAND (bfr, 1), 1);
- start_offset = tree_low_cst (TREE_OPERAND (bfr, 2), 1);
+ start_offset = access->offset
+ + tree_low_cst (TREE_OPERAND (bfr, 2), 1);
}
else
start_offset = chunk_size = 0;