aboutsummaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2017-02-07 11:29:06 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2017-02-07 11:29:06 +0000
commita4cf4b647cd239cc57d88ed82f7243e7efdf43f5 (patch)
tree9fc890de85ab3e01588ab9bf2c29333aec48c2bb /gcc/stor-layout.c
parent7af4b20d83a8ce3033148f0d14c2e725791a7afd (diff)
downloadgcc-a4cf4b647cd239cc57d88ed82f7243e7efdf43f5.zip
gcc-a4cf4b647cd239cc57d88ed82f7243e7efdf43f5.tar.gz
gcc-a4cf4b647cd239cc57d88ed82f7243e7efdf43f5.tar.bz2
re PR tree-optimization/79256 (FAIL: gcc.dg/vect/pr25413a.c execution test)
2017-02-07 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. * doc/tm.texi.in (ADJUST_FIELD_ALIGN): Adjust to take additional type parameter. * doc/tm.texi: Regenerate. * stor-layout.c (layout_decl): Adjust. (update_alignment_for_field): Likewise. (place_field): Likewise. (min_align_of_type): Likewise. * config/arc/arc.h (ADJUST_FIELD_ALIGN): Adjust. * config/epiphany/epiphany.h (ADJUST_FIELD_ALIGN): Likewise. * config/epiphany/epiphany.c (epiphany_adjust_field_align): Likewise. * config/frv/frv.h (ADJUST_FIELD_ALIGN): Likewise. * config/frv/frv.c (frv_adjust_field_align): Likewise. * config/i386/i386.h (ADJUST_FIELD_ALIGN): Likewise. * config/i386/i386.c (x86_field_alignment): Likewise. * config/rs6000/aix.h (ADJUST_FIELD_ALIGN): Likewise. * config/rs6000/darwin.h (ADJUST_FIELD_ALIGN): Likewise. * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise. * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise. * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Likewise. * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): Likewise. go/ * go-backend.c (go_field_alignment): Adjust. libobjc/ * encoding.c (objc_layout_structure_next_member): Adjust ADJUST_FIELD_ALIGN usage. Revert 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. From-SVN: r245245
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 7ad34f7..d0beebf 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -718,7 +718,8 @@ layout_decl (tree decl, unsigned int known_align)
(unsigned) BIGGEST_FIELD_ALIGNMENT));
#endif
#ifdef ADJUST_FIELD_ALIGN
- SET_DECL_ALIGN (decl, ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl)));
+ SET_DECL_ALIGN (decl, ADJUST_FIELD_ALIGN (decl, TREE_TYPE (decl),
+ DECL_ALIGN (decl)));
#endif
}
@@ -1032,7 +1033,7 @@ update_alignment_for_field (record_layout_info rli, tree field,
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ type_align = ADJUST_FIELD_ALIGN (field, type, type_align);
#endif
/* Targets might chose to handle unnamed and hence possibly
@@ -1260,7 +1261,7 @@ place_field (record_layout_info rli, tree field)
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ type_align = ADJUST_FIELD_ALIGN (field, type, type_align);
#endif
/* A bit field may not span more units of alignment of its type
@@ -1303,7 +1304,7 @@ place_field (record_layout_info rli, tree field)
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ type_align = ADJUST_FIELD_ALIGN (field, type, type_align);
#endif
if (maximum_field_alignment != 0)
@@ -2411,9 +2412,7 @@ min_align_of_type (tree type)
#endif
unsigned int field_align = align;
#ifdef ADJUST_FIELD_ALIGN
- tree field = build_decl (UNKNOWN_LOCATION, FIELD_DECL, NULL_TREE, type);
- field_align = ADJUST_FIELD_ALIGN (field, field_align);
- ggc_free (field);
+ field_align = ADJUST_FIELD_ALIGN (NULL_TREE, type, field_align);
#endif
align = MIN (align, field_align);
}