Commit fcc216ec by Richard Biener Committed by Richard Biener

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
parent 1dd95239
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> 2017-01-30 Dominik Vogt <vogt@linux.vnet.ibm.com>
PR target/79240 PR target/79240
......
...@@ -1130,9 +1130,14 @@ default_vector_alignment (const_tree type) ...@@ -1130,9 +1130,14 @@ default_vector_alignment (const_tree type)
/* By default assume vectors of element TYPE require a multiple of the natural /* 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. */ alignment of TYPE. TYPE is naturally aligned if IS_PACKED is false. */
bool 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 /* By default, assume that a target supports any factor of misalignment
......
...@@ -6684,6 +6684,7 @@ build_aligned_type (tree type, unsigned int align) ...@@ -6684,6 +6684,7 @@ build_aligned_type (tree type, unsigned int align)
t = build_variant_type_copy (type); t = build_variant_type_copy (type);
SET_TYPE_ALIGN (t, align); SET_TYPE_ALIGN (t, align);
TYPE_USER_ALIGN (t) = 1;
return t; return t;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment