diff options
author | Richard Biener <rguenther@suse.de> | 2017-02-07 11:29:06 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2017-02-07 11:29:06 +0000 |
commit | a4cf4b647cd239cc57d88ed82f7243e7efdf43f5 (patch) | |
tree | 9fc890de85ab3e01588ab9bf2c29333aec48c2bb /gcc/config | |
parent | 7af4b20d83a8ce3033148f0d14c2e725791a7afd (diff) | |
download | gcc-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/config')
-rw-r--r-- | gcc/config/arc/arc.h | 4 | ||||
-rw-r--r-- | gcc/config/epiphany/epiphany.c | 6 | ||||
-rw-r--r-- | gcc/config/epiphany/epiphany.h | 4 | ||||
-rw-r--r-- | gcc/config/frv/frv.c | 3 | ||||
-rw-r--r-- | gcc/config/frv/frv.h | 2 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 3 | ||||
-rw-r--r-- | gcc/config/i386/i386.h | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/aix.h | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/darwin.h | 2 | ||||
-rw-r--r-- | gcc/config/rs6000/freebsd64.h | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/linux64.h | 6 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/sysv4.h | 4 |
13 files changed, 26 insertions, 26 deletions
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 9cf7668..b6464f1 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -317,8 +317,8 @@ if (GET_MODE_CLASS (MODE) == MODE_INT \ construct. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ -(TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ +(TYPE_MODE (strip_array_types (TYPE)) == DFmode \ ? MIN ((COMPUTED), 32) : (COMPUTED)) diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c index f8fa9bd..41864f2 100644 --- a/gcc/config/epiphany/epiphany.c +++ b/gcc/config/epiphany/epiphany.c @@ -2855,12 +2855,12 @@ epiphany_special_round_type_align (tree type, unsigned computed, arrays-at-the-end-of-structs work, like for struct gcov_fn_info in libgcov.c . */ unsigned -epiphany_adjust_field_align (tree field, unsigned computed) +epiphany_adjust_field_align (tree type, unsigned computed) { if (computed == 32 - && TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE) + && TREE_CODE (type) == ARRAY_TYPE) { - tree elmsz = TYPE_SIZE (TREE_TYPE (TREE_TYPE (field))); + tree elmsz = TYPE_SIZE (TREE_TYPE (type)); if (!tree_fits_uhwi_p (elmsz) || tree_to_uhwi (elmsz) >= 32) return 64; diff --git a/gcc/config/epiphany/epiphany.h b/gcc/config/epiphany/epiphany.h index a9249a4..d20d400 100644 --- a/gcc/config/epiphany/epiphany.h +++ b/gcc/config/epiphany/epiphany.h @@ -187,8 +187,8 @@ along with GCC; see the file COPYING3. If not see (SPECIFIED_ALIGN)) \ : MAX ((MANGLED_ALIGN), (SPECIFIED_ALIGN))) -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - epiphany_adjust_field_align((FIELD), (COMPUTED)) +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ + epiphany_adjust_field_align((TYPE), (COMPUTED)) /* Layout of source language data types. */ diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index a5c3313..0918b98 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -6482,7 +6482,8 @@ int frv_adjust_field_align (tree field, int computed) { /* Make sure that the bitfield is not wider than the type. */ - if (DECL_BIT_FIELD (field) + if (field + && DECL_BIT_FIELD (field) && !DECL_ARTIFICIAL (field)) { tree parent = DECL_CONTEXT (field); diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h index 8fcb170..4acaabb 100644 --- a/gcc/config/frv/frv.h +++ b/gcc/config/frv/frv.h @@ -331,7 +331,7 @@ alignment computed in the usual way is COMPUTED. GCC uses this value instead of the value in `BIGGEST_ALIGNMENT' or `BIGGEST_FIELD_ALIGNMENT', if defined, for structure fields only. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ frv_adjust_field_align (FIELD, COMPUTED) #endif diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 3a65945..d7dce4b 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -41691,10 +41691,9 @@ x86_file_start (void) } int -x86_field_alignment (tree field, int computed) +x86_field_alignment (tree type, int computed) { machine_mode mode; - tree type = TREE_TYPE (field); if (TARGET_64BIT || TARGET_ALIGN_DOUBLE) return computed; diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index aeacf0f..f225b3e 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -847,8 +847,8 @@ extern const char *host_detect_local_cpu (int argc, const char **argv); #define BIGGEST_FIELD_ALIGNMENT 32 #endif #else -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - x86_field_alignment ((FIELD), (COMPUTED)) +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ + x86_field_alignment ((TYPE), (COMPUTED)) #endif /* If defined, a C expression to compute the alignment given to a diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h index 51801a2..b90e2b0 100644 --- a/gcc/config/rs6000/aix.h +++ b/gcc/config/rs6000/aix.h @@ -218,9 +218,9 @@ /* This now supports a natural alignment mode. */ /* AIX word-aligns FP doubles but doubleword-aligns 64-bit ints. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ ((TARGET_ALIGN_NATURAL == 0 \ - && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \ + && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \ ? MIN ((COMPUTED), 32) \ : (COMPUTED)) diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h index 397ab1c..61e5e83 100644 --- a/gcc/config/rs6000/darwin.h +++ b/gcc/config/rs6000/darwin.h @@ -319,7 +319,7 @@ extern int darwin_emit_branch_islands; suppressed for vector and long double items (both 128 in size). There is a dummy use of the FIELD argument to avoid an unused variable warning (see PR59496). */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ ((void) (FIELD), \ (TARGET_ALIGN_NATURAL \ ? (COMPUTED) \ diff --git a/gcc/config/rs6000/freebsd64.h b/gcc/config/rs6000/freebsd64.h index 8f4bb61..d75ac2b 100644 --- a/gcc/config/rs6000/freebsd64.h +++ b/gcc/config/rs6000/freebsd64.h @@ -365,12 +365,12 @@ extern int dot_symbols; /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */ #undef ADJUST_FIELD_ALIGN -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ + (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \ ? 128 \ : (TARGET_64BIT \ && TARGET_ALIGN_NATURAL == 0 \ - && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \ + && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \ ? MIN ((COMPUTED), 32) \ : (COMPUTED)) diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h index da0e575..71e35b7 100644 --- a/gcc/config/rs6000/linux64.h +++ b/gcc/config/rs6000/linux64.h @@ -292,12 +292,12 @@ extern int dot_symbols; /* PowerPC64 Linux word-aligns FP doubles when -malign-power is given. */ #undef ADJUST_FIELD_ALIGN -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ + (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \ ? 128 \ : (TARGET_64BIT \ && TARGET_ALIGN_NATURAL == 0 \ - && TYPE_MODE (strip_array_types (TREE_TYPE (FIELD))) == DFmode) \ + && TYPE_MODE (strip_array_types (TYPE)) == DFmode) \ ? MIN ((COMPUTED), 32) \ : (COMPUTED)) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 37e5458..f1dec8c 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -7975,9 +7975,9 @@ rs6000_data_alignment (tree type, unsigned int align, enum data_align how) /* Previous GCC releases forced all vector types to have 16-byte alignment. */ bool -rs6000_special_adjust_field_align_p (tree field, unsigned int computed) +rs6000_special_adjust_field_align_p (tree type, unsigned int computed) { - if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE) + if (TARGET_ALTIVEC && TREE_CODE (type) == VECTOR_TYPE) { if (computed != 128) { diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index a5abeee..de38629 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -298,8 +298,8 @@ do { \ /* An expression for the alignment of a structure field FIELD if the alignment computed in the usual way is COMPUTED. */ -#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \ - (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED)) \ +#define ADJUST_FIELD_ALIGN(FIELD, TYPE, COMPUTED) \ + (rs6000_special_adjust_field_align_p ((TYPE), (COMPUTED)) \ ? 128 : COMPUTED) #undef BIGGEST_FIELD_ALIGNMENT |