aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-10-29 17:55:50 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-10-29 17:55:50 +0200
commita654d5d013b0d35baa09e1c9344847b864a94cfe (patch)
tree6088b9177e233528e241aa4261e11c5f0d384c84
parent2bc99a1a94d85532caa3c20bbb58cea6df2ebd6c (diff)
downloadgcc-a654d5d013b0d35baa09e1c9344847b864a94cfe.zip
gcc-a654d5d013b0d35baa09e1c9344847b864a94cfe.tar.gz
gcc-a654d5d013b0d35baa09e1c9344847b864a94cfe.tar.bz2
re PR tree-optimization/78148 (r241649 causes -fcompare-debug failure on ppc64le)
PR target/78148 * gimple-ssa-store-merging.c (imm_store_chain_info::output_merged_store): Use build_aligned_type instead of SET_TYPE_ALIGN on shared integral type. * gcc.dg/pr78148.c: New test. From-SVN: r241679
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/gimple-ssa-store-merging.c2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/pr78148.c31
4 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2a74c71..852426a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2016-10-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/78148
+ * gimple-ssa-store-merging.c
+ (imm_store_chain_info::output_merged_store): Use build_aligned_type
+ instead of SET_TYPE_ALIGN on shared integral type.
+
2016-10-29 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.h (BIGGEST_ALIGNMENT): Adjust comment.
diff --git a/gcc/gimple-ssa-store-merging.c b/gcc/gimple-ssa-store-merging.c
index 5a293d7..97af141 100644
--- a/gcc/gimple-ssa-store-merging.c
+++ b/gcc/gimple-ssa-store-merging.c
@@ -1130,7 +1130,7 @@ imm_store_chain_info::output_merged_store (tree base, merged_store_group *group)
location_t loc = get_location_for_stmts (split_store->orig_stmts);
tree int_type = build_nonstandard_integer_type (try_size, UNSIGNED);
- SET_TYPE_ALIGN (int_type, align);
+ int_type = build_aligned_type (int_type, align);
tree addr = build_fold_addr_expr (base);
tree dest = fold_build2 (MEM_REF, int_type, addr,
build_int_cst (offset_type, try_pos));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 087d4f3..d23181c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/78148
+ * gcc.dg/pr78148.c: New test.
+
2016-10-28 Eric Botcazou <ebotcazou@adacore.com>
* gcc.target/sparc/overflow-3.c: Replace and move old one to...
diff --git a/gcc/testsuite/gcc.dg/pr78148.c b/gcc/testsuite/gcc.dg/pr78148.c
new file mode 100644
index 0000000..c3c9b2e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr78148.c
@@ -0,0 +1,31 @@
+/* PR target/78148 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fcompare-debug" } */
+
+struct A { int a, b; };
+struct B { char c, d; };
+extern void bar (struct A, struct B);
+struct C { char e, f; } a;
+struct D
+{
+ int g;
+ struct C h[4];
+};
+struct D *e;
+
+struct D
+foo (void)
+{
+ int b;
+ struct B c;
+ struct A d;
+ d.b = c.c = c.d = 0;
+ bar (d, c);
+}
+
+void
+baz ()
+{
+ e->h[0].e = e->h[0].f = 0;
+ foo ();
+}