]> gcc.gnu.org Git - gcc.git/commitdiff
rs6000-protos.h (rs6000_special_adjust_field_align_p): Add prototype.
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 24 Jul 2014 17:15:12 +0000 (17:15 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Thu, 24 Jul 2014 17:15:12 +0000 (17:15 +0000)
gcc/

* config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
Add prototype.
* config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
function.
* config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
* config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
* config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.

gcc/testsuite/

* gcc.target/powerpc/ppc64-abi-warn-3.c: New test.

* gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
* gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
* gcc.c-torture/execute/20050316-3.x: New file.  Add -Wno-psabi.
* gcc.c-torture/execute/pr23135.x: Likewise.

From-SVN: r213017

12 files changed:
gcc/ChangeLog
gcc/config/rs6000/freebsd64.h
gcc/config/rs6000/linux64.h
gcc/config/rs6000/rs6000-protos.h
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/sysv4.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20050316-1.x
gcc/testsuite/gcc.c-torture/execute/20050316-3.x [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20050604-1.x
gcc/testsuite/gcc.c-torture/execute/pr23135.x [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c [new file with mode: 0644]

index 5436866a48da8d79575e260d15332d4c403b694d..8343c897408617224e8740f2c3e6dc88562df183 100644 (file)
@@ -1,3 +1,13 @@
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/rs6000/rs6000-protos.h (rs6000_special_adjust_field_align_p):
+       Add prototype.
+       * config/rs6000/rs6000.c (rs6000_special_adjust_field_align_p): New
+       function.
+       * config/rs6000/sysv4.h (ADJUST_FIELD_ALIGN): Call it.
+       * config/rs6000/linux64.h (ADJUST_FIELD_ALIGN): Likewise.
+       * config/rs6000/freebsd64.h (ADJUST_FIELD_ALIGN): Likewise.
+
 2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * config/rs6000/rs6000.c (rs6000_function_arg_boundary): In the AIX
index 4f678f6f4d12779f65c79844711bfdb657bc7a49..1f3ef199e867d03466d93d92bd13616f7ff371c8 100644 (file)
@@ -367,7 +367,7 @@ 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) \
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
    ? 128                                                                \
    : (TARGET_64BIT                                                      \
       && TARGET_ALIGN_NATURAL == 0                                      \
index dbc9a527efab35da27ded9a632bdef4ebe52ceec..0ca05d2f6a24c7f70eb4279558a8ef647ee9e778 100644 (file)
@@ -246,7 +246,7 @@ 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) \
-  ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)    \
+  (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))           \
    ? 128                                                               \
    : (TARGET_64BIT                                                     \
       && TARGET_ALIGN_NATURAL == 0                                     \
index 83581ac0bfbc1ae4b7b3f09f46e093dba93387dd..82564db5c905dc063d7758b1a076c0653cea89ee 100644 (file)
@@ -155,6 +155,7 @@ extern void rs6000_split_logical (rtx [], enum rtx_code, bool, bool, bool, rtx);
 
 #ifdef TREE_CODE
 extern unsigned int rs6000_data_alignment (tree, unsigned int, enum data_align);
+extern bool rs6000_special_adjust_field_align_p (tree, unsigned int);
 extern unsigned int rs6000_special_round_type_align (tree, unsigned int,
                                                     unsigned int);
 extern unsigned int darwin_rs6000_special_round_type_align (tree, unsigned int,
index 49d50a6874cbc183e5a1974d62d788af2fd96e61..b52b8a1af1a388d4bb34ee89b078ba31d7128708 100644 (file)
@@ -5880,6 +5880,32 @@ rs6000_data_alignment (tree type, unsigned int align, enum data_align how)
   return align;
 }
 
+/* Previous GCC releases forced all vector types to have 16-byte alignment.  */
+
+bool
+rs6000_special_adjust_field_align_p (tree field, unsigned int computed)
+{
+  if (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (field)) == VECTOR_TYPE)
+    {
+      if (computed != 128)
+       {
+         static bool warned;
+         if (!warned && warn_psabi)
+           {
+             warned = true;
+             inform (input_location,
+                     "the layout of aggregates containing vectors with"
+                     " %d-byte alignment has changed in GCC 4.10",
+                     computed / BITS_PER_UNIT);
+           }
+       }
+      /* In current GCC there is no special case.  */
+      return false;
+    }
+
+  return false;
+}
+
 /* AIX increases natural record alignment to doubleword if the first
    field is an FP double while the FP fields remain word aligned.  */
 
index d04e6e4a04012255e3738e2b64c74d9fbc4353ce..b96c5d933176dcf8ba54c893fc30108cc0cc1479 100644 (file)
@@ -292,7 +292,7 @@ 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)                                  \
-       ((TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)     \
+       (rs6000_special_adjust_field_align_p ((FIELD), (COMPUTED))            \
         ? 128 : COMPUTED)
 
 #undef  BIGGEST_FIELD_ALIGNMENT
index bf929fa924ee759af3cad818ee6cdd9832acad00..17daa074a940ef7f36f0e07f528e42436505b9f8 100644 (file)
@@ -1,3 +1,12 @@
+2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * gcc.target/powerpc/ppc64-abi-warn-3.c: New test.
+
+       * gcc.c-torture/execute/20050316-1.x: Add -Wno-psabi.
+       * gcc.c-torture/execute/20050604-1.x: Add -Wno-psabi.
+       * gcc.c-torture/execute/20050316-3.x: New file.  Add -Wno-psabi.
+       * gcc.c-torture/execute/pr23135.x: Likewise.
+
 2014-07-24  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * gcc.target/powerpc/ppc64-abi-warn-2.c: New test.
index 121fcfecc2c22fd274926e06105d20e909831f99..cb2d28fd9fc9f71196a860a34e9189664064134d 100644 (file)
@@ -4,4 +4,5 @@ if { [check_effective_target_int16] } {
        return 1
 }
 
+set additional_flags "-Wno-psabi"
 return 0;
diff --git a/gcc/testsuite/gcc.c-torture/execute/20050316-3.x b/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
new file mode 100644 (file)
index 0000000..cb7b119
--- /dev/null
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
index f5b4aaae3d9696c8f426f031810b6bc9771656ad..756242d23450da0daff95528b6c912b9b3581707 100644 (file)
@@ -6,4 +6,5 @@ if { [istarget "i?86-*-*"] || [istarget "x86_64-*-*"] } {
        set additional_flags "-mno-mmx"
 }
 
+set additional_flags "-Wno-psabi"
 return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr23135.x b/gcc/testsuite/gcc.c-torture/execute/pr23135.x
new file mode 100644 (file)
index 0000000..cb7b119
--- /dev/null
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
diff --git a/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c b/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
new file mode 100644 (file)
index 0000000..22cad0c
--- /dev/null
@@ -0,0 +1,9 @@
+/* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */
+/* { dg-require-effective-target powerpc_altivec_ok } */
+/* { dg-options "-maltivec" } */
+
+struct test
+  {
+    int a __attribute__((vector_size (8)));
+  }; /* { dg-message "note: the layout of aggregates containing vectors with 8-byte alignment has changed" } */
+
This page took 0.121327 seconds and 5 git commands to generate.