aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-01-30 13:52:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-01-30 13:52:44 +0000
commitfcc216ec44d7403368285c045846d4419b631cb5 (patch)
tree5d4c8a4d888816010dd37f924c0f8f1dbb1bf95a
parent1dd9523917189b741af87cc3fbb853c30d7773f5 (diff)
downloadgcc-fcc216ec44d7403368285c045846d4419b631cb5.zip
gcc-fcc216ec44d7403368285c045846d4419b631cb5.tar.gz
gcc-fcc216ec44d7403368285c045846d4419b631cb5.tar.bz2
re PR tree-optimization/79256 (FAIL: gcc.dg/vect/pr25413a.c execution test)
2017-01-30 Richard Biener <rguenther@suse.de> PR tree-optimization/79256 * targhooks.c (default_builtin_vector_alignment_reachable): Honor BIGGEST_FIELD_ALIGNMENT and ADJUST_FIELD_ALIGN to fix up bogus alignment on TYPE. * tree.c (build_aligned_type): Set TYPE_USER_ALIGN. From-SVN: r245025
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/targhooks.c9
-rw-r--r--gcc/tree.c1
3 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 30b0785..96a210e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2017-01-30 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/79256
+ * targhooks.c (default_builtin_vector_alignment_reachable): Honor
+ BIGGEST_FIELD_ALIGNMENT and ADJUST_FIELD_ALIGN to fix up bogus
+ alignment on TYPE.
+ * tree.c (build_aligned_type): Set TYPE_USER_ALIGN.
+
2017-01-30 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79240
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 1cdec06..bf5d0d4 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -1130,9 +1130,14 @@ default_vector_alignment (const_tree type)
/* By default assume vectors of element TYPE require a multiple of the natural
alignment of TYPE. TYPE is naturally aligned if IS_PACKED is false. */
bool
-default_builtin_vector_alignment_reachable (const_tree /*type*/, bool is_packed)
+default_builtin_vector_alignment_reachable (const_tree type, bool is_packed)
{
- return ! is_packed;
+ if (is_packed)
+ return false;
+
+ /* If TYPE can be differently aligned in field context we have to punt
+ as TYPE may have wrong TYPE_ALIGN here (PR79278). */
+ return min_align_of_type (CONST_CAST_TREE (type)) == TYPE_ALIGN_UNIT (type);
}
/* By default, assume that a target supports any factor of misalignment
diff --git a/gcc/tree.c b/gcc/tree.c
index 10b747e..8426834 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -6684,6 +6684,7 @@ build_aligned_type (tree type, unsigned int align)
t = build_variant_type_copy (type);
SET_TYPE_ALIGN (t, align);
+ TYPE_USER_ALIGN (t) = 1;
return t;
}