===================================================================
@@ -1130,9 +1130,14 @@ default_vector_alignment (const_tree typ
/* 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
===================================================================
@@ -6684,6 +6684,7 @@ build_aligned_type (tree type, unsigned
t = build_variant_type_copy (type);
SET_TYPE_ALIGN (t, align);
+ TYPE_USER_ALIGN (t) = 1;
return t;
}
2017-01-30 Richard Biener <rguenther@suse.de>
PR tree-optimization/79256
PR middle-end/79278
* builtins.c (get_object_alignment_2): Use min_align_of_type
to extract alignment for MEM_REFs to honor BIGGEST_FIELD_ALIGNMENT
and ADJUST_FIELD_ALIGN.
===================================================================
@@ -334,9 +334,11 @@ get_object_alignment_2 (tree exp, unsign
Do so only if get_pointer_alignment_1 did not reveal absolute
alignment knowledge and if using that alignment would
improve the situation. */
+ unsigned int talign;
if (!addr_p && !known_alignment
- && TYPE_ALIGN (TREE_TYPE (exp)) > align)
- align = TYPE_ALIGN (TREE_TYPE (exp));
+ && (talign = min_align_of_type (TREE_TYPE (exp)) * BITS_PER_UNIT)
+ && talign > align)
+ align = talign;
else
{
/* Else adjust bitpos accordingly. */
2017-01-30 Richard Biener <rguenther@suse.de>
PR target/79277
* config/i386/i386-modes.def: Align DFmode properly.
===================================================================
@@ -33,6 +33,7 @@ ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_
: &ieee_extended_intel_96_format));
ADJUST_BYTESIZE (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 12);
ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4);
+ADJUST_ALIGNMENT (DF, !TARGET_64BIT ? 4 : 8);
/* Add any extra modes needed to represent the condition code.