aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-sra.cc')
-rw-r--r--gcc/tree-sra.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-sra.cc b/gcc/tree-sra.cc
index 240af67..032f277 100644
--- a/gcc/tree-sra.cc
+++ b/gcc/tree-sra.cc
@@ -2504,6 +2504,12 @@ sort_and_splice_var_accesses (tree var)
}
unscalarizable_region = true;
}
+ /* If there the same place is accessed with two incompatible
+ aggregate types, trying to base total scalarization on either of
+ them can be wrong. */
+ if (!first_scalar && !types_compatible_p (access->type, ac2->type))
+ bitmap_set_bit (cannot_scalarize_away_bitmap,
+ DECL_UID (access->base));
if (grp_same_access_path
&& (!ac2->grp_same_access_path