public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
@ 2014-07-17  0:42 Ulrich Weigand
  2014-07-18 16:11 ` David Edelsohn
  2014-07-26 12:08 ` Matthias Klose
  0 siblings, 2 replies; 11+ messages in thread
From: Ulrich Weigand @ 2014-07-17  0:42 UTC (permalink / raw)
  To: gcc-patches; +Cc: dje.gcc

Hello,

this is the variant intended for the 4.8/4.9 branches of the patch:
https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html

As discussed, it does *not* actually change ABI, but only warn when
encountering a situation where the ABI will change in a future GCC.
(Avoiding the specific term "GCC 4.10" here since I'm not certain
whether the next GCC release will in fact be called that ...)

Tested on powerpc64-linux and powerpc64le-linux; also verified using
the ABI compat suite (against an unpatched GCC) that this patch does
not change the ABI.

OK for 4.8/4.9 once the mainline patch is in?

Bye,
Ulrich


gcc/ChangeLog:

	* 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.  Issue -Wpsabi warning if future GCC releases will use
	different field alignment rules for this type.
	* 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/ChangeLog:

	* 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.

Index: gcc-4_9-branch/gcc/config/rs6000/rs6000-protos.h
===================================================================
--- gcc-4_9-branch.orig/gcc/config/rs6000/rs6000-protos.h
+++ gcc-4_9-branch/gcc/config/rs6000/rs6000-protos.h
@@ -155,6 +155,7 @@ extern void rs6000_split_logical (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: gcc-4_9-branch/gcc/config/rs6000/rs6000.c
===================================================================
--- gcc-4_9-branch.orig/gcc/config/rs6000/rs6000.c
+++ gcc-4_9-branch/gcc/config/rs6000/rs6000.c
@@ -5871,6 +5871,34 @@ rs6000_data_alignment (tree type, unsign
   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 will change in a future GCC release",
+		      computed / BITS_PER_UNIT);
+	    }
+	}
+      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
+	 keep the special treatment of vector types, but warn if there will
+	 be differences in future GCC releases.  */
+      return true;
+    }
+
+  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: gcc-4_9-branch/gcc/config/rs6000/sysv4.h
===================================================================
--- gcc-4_9-branch.orig/gcc/config/rs6000/sysv4.h
+++ gcc-4_9-branch/gcc/config/rs6000/sysv4.h
@@ -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: gcc-4_9-branch/gcc/config/rs6000/linux64.h
===================================================================
--- gcc-4_9-branch.orig/gcc/config/rs6000/linux64.h
+++ gcc-4_9-branch/gcc/config/rs6000/linux64.h
@@ -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: gcc-4_9-branch/gcc/config/rs6000/freebsd64.h
===================================================================
--- gcc-4_9-branch.orig/gcc/config/rs6000/freebsd64.h
+++ gcc-4_9-branch/gcc/config/rs6000/freebsd64.h
@@ -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: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
===================================================================
--- gcc-4_9-branch.orig/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
+++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
@@ -4,4 +4,5 @@ if { [check_effective_target_int16] } {
 	return 1
 }
 
+set additional_flags "-Wno-psabi"
 return 0;
Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
===================================================================
--- /dev/null
+++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
===================================================================
--- gcc-4_9-branch.orig/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
+++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
@@ -6,4 +6,5 @@ if { [istarget "i?86-*-*"] || [istarget
 	set additional_flags "-mno-mmx"
 }
 
+set additional_flags "-Wno-psabi"
 return 0
Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr23135.x
===================================================================
--- /dev/null
+++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr23135.x
@@ -0,0 +1,2 @@
+set additional_flags "-Wno-psabi"
+return 0
Index: gcc-4_9-branch/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
===================================================================
--- /dev/null
+++ gcc-4_9-branch/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
@@ -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 will change" } */
+
-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-17  0:42 [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields Ulrich Weigand
@ 2014-07-18 16:11 ` David Edelsohn
  2014-07-18 16:51   ` Jakub Jelinek
  2014-07-26 12:08 ` Matthias Klose
  1 sibling, 1 reply; 11+ messages in thread
From: David Edelsohn @ 2014-07-18 16:11 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: GCC Patches, Jakub Jelinek

This patch is okay with me if okay with the Release Managers.

Thanks, David

On Wed, Jul 16, 2014 at 8:41 PM, Ulrich Weigand <uweigand@de.ibm.com> wrote:
> Hello,
>
> this is the variant intended for the 4.8/4.9 branches of the patch:
> https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
>
> As discussed, it does *not* actually change ABI, but only warn when
> encountering a situation where the ABI will change in a future GCC.
> (Avoiding the specific term "GCC 4.10" here since I'm not certain
> whether the next GCC release will in fact be called that ...)
>
> Tested on powerpc64-linux and powerpc64le-linux; also verified using
> the ABI compat suite (against an unpatched GCC) that this patch does
> not change the ABI.
>
> OK for 4.8/4.9 once the mainline patch is in?
>
> Bye,
> Ulrich
>
>
> gcc/ChangeLog:
>
>         * 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.  Issue -Wpsabi warning if future GCC releases will use
>         different field alignment rules for this type.
>         * 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/ChangeLog:
>
>         * 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.
>
> Index: gcc-4_9-branch/gcc/config/rs6000/rs6000-protos.h
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/config/rs6000/rs6000-protos.h
> +++ gcc-4_9-branch/gcc/config/rs6000/rs6000-protos.h
> @@ -155,6 +155,7 @@ extern void rs6000_split_logical (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: gcc-4_9-branch/gcc/config/rs6000/rs6000.c
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/config/rs6000/rs6000.c
> +++ gcc-4_9-branch/gcc/config/rs6000/rs6000.c
> @@ -5871,6 +5871,34 @@ rs6000_data_alignment (tree type, unsign
>    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 will change in a future GCC release",
> +                     computed / BITS_PER_UNIT);
> +           }
> +       }
> +      /* GCC 4.8/4.9 Note: To avoid any ABI change on a release branch, we
> +        keep the special treatment of vector types, but warn if there will
> +        be differences in future GCC releases.  */
> +      return true;
> +    }
> +
> +  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: gcc-4_9-branch/gcc/config/rs6000/sysv4.h
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/config/rs6000/sysv4.h
> +++ gcc-4_9-branch/gcc/config/rs6000/sysv4.h
> @@ -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: gcc-4_9-branch/gcc/config/rs6000/linux64.h
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/config/rs6000/linux64.h
> +++ gcc-4_9-branch/gcc/config/rs6000/linux64.h
> @@ -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: gcc-4_9-branch/gcc/config/rs6000/freebsd64.h
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/config/rs6000/freebsd64.h
> +++ gcc-4_9-branch/gcc/config/rs6000/freebsd64.h
> @@ -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: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
> +++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-1.x
> @@ -4,4 +4,5 @@ if { [check_effective_target_int16] } {
>         return 1
>  }
>
> +set additional_flags "-Wno-psabi"
>  return 0;
> Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
> ===================================================================
> --- /dev/null
> +++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050316-3.x
> @@ -0,0 +1,2 @@
> +set additional_flags "-Wno-psabi"
> +return 0
> Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
> ===================================================================
> --- gcc-4_9-branch.orig/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
> +++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/20050604-1.x
> @@ -6,4 +6,5 @@ if { [istarget "i?86-*-*"] || [istarget
>         set additional_flags "-mno-mmx"
>  }
>
> +set additional_flags "-Wno-psabi"
>  return 0
> Index: gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr23135.x
> ===================================================================
> --- /dev/null
> +++ gcc-4_9-branch/gcc/testsuite/gcc.c-torture/execute/pr23135.x
> @@ -0,0 +1,2 @@
> +set additional_flags "-Wno-psabi"
> +return 0
> Index: gcc-4_9-branch/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
> ===================================================================
> --- /dev/null
> +++ gcc-4_9-branch/gcc/testsuite/gcc.target/powerpc/ppc64-abi-warn-3.c
> @@ -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 will change" } */
> +
> --
>   Dr. Ulrich Weigand
>   GNU/Linux compilers and toolchain
>   Ulrich.Weigand@de.ibm.com
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-18 16:11 ` David Edelsohn
@ 2014-07-18 16:51   ` Jakub Jelinek
  0 siblings, 0 replies; 11+ messages in thread
From: Jakub Jelinek @ 2014-07-18 16:51 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Ulrich Weigand, GCC Patches

On Fri, Jul 18, 2014 at 12:01:21PM -0400, David Edelsohn wrote:
> This patch is okay with me if okay with the Release Managers.

Ok.

	Jakub

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-17  0:42 [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields Ulrich Weigand
  2014-07-18 16:11 ` David Edelsohn
@ 2014-07-26 12:08 ` Matthias Klose
  2014-07-27  9:51   ` Alan Modra
  1 sibling, 1 reply; 11+ messages in thread
From: Matthias Klose @ 2014-07-26 12:08 UTC (permalink / raw)
  To: Ulrich Weigand, gcc-patches; +Cc: dje.gcc

Am 17.07.2014 02:41, schrieb Ulrich Weigand:
> Hello,
> 
> this is the variant intended for the 4.8/4.9 branches of the patch:
> https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
> 
> As discussed, it does *not* actually change ABI, but only warn when
> encountering a situation where the ABI will change in a future GCC.
> (Avoiding the specific term "GCC 4.10" here since I'm not certain
> whether the next GCC release will in fact be called that ...)
> 
> Tested on powerpc64-linux and powerpc64le-linux; also verified using
> the ABI compat suite (against an unpatched GCC) that this patch does
> not change the ABI.

this causes PR libobjc/61920, link failures with -lobjc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-26 12:08 ` Matthias Klose
@ 2014-07-27  9:51   ` Alan Modra
  2014-07-27 11:59     ` Alan Modra
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Modra @ 2014-07-27  9:51 UTC (permalink / raw)
  To: Matthias Klose; +Cc: Ulrich Weigand, gcc-patches, dje.gcc

On Sat, Jul 26, 2014 at 01:45:12PM +0200, Matthias Klose wrote:
> Am 17.07.2014 02:41, schrieb Ulrich Weigand:
> > Hello,
> > 
> > this is the variant intended for the 4.8/4.9 branches of the patch:
> > https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
> > 
> > As discussed, it does *not* actually change ABI, but only warn when
> > encountering a situation where the ABI will change in a future GCC.
> > (Avoiding the specific term "GCC 4.10" here since I'm not certain
> > whether the next GCC release will in fact be called that ...)
> > 
> > Tested on powerpc64-linux and powerpc64le-linux; also verified using
> > the ABI compat suite (against an unpatched GCC) that this patch does
> > not change the ABI.
> 
> this causes PR libobjc/61920, link failures with -lobjc.

Try this.

Index: libobjc/encoding.c
===================================================================
--- libobjc/encoding.c	(revision 213090)
+++ libobjc/encoding.c	(working copy)
@@ -192,6 +192,7 @@
    ? MAX (MAX (COMPUTED, SPECIFIED), 64)				\
    : MAX (COMPUTED, SPECIFIED));})
 
+#define rs6000_special_adjust_field_align_p false
 
 /* Skip a variable name, enclosed in quotes (").  */
 static inline

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-27  9:51   ` Alan Modra
@ 2014-07-27 11:59     ` Alan Modra
  2014-07-27 12:31       ` pinskia
  0 siblings, 1 reply; 11+ messages in thread
From: Alan Modra @ 2014-07-27 11:59 UTC (permalink / raw)
  To: Matthias Klose, Ulrich Weigand, gcc-patches, dje.gcc

On Sun, Jul 27, 2014 at 07:16:07PM +0930, Alan Modra wrote:
> On Sat, Jul 26, 2014 at 01:45:12PM +0200, Matthias Klose wrote:
> > Am 17.07.2014 02:41, schrieb Ulrich Weigand:
> > > Hello,
> > > 
> > > this is the variant intended for the 4.8/4.9 branches of the patch:
> > > https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
> > > 
> > > As discussed, it does *not* actually change ABI, but only warn when
> > > encountering a situation where the ABI will change in a future GCC.
> > > (Avoiding the specific term "GCC 4.10" here since I'm not certain
> > > whether the next GCC release will in fact be called that ...)
> > > 
> > > Tested on powerpc64-linux and powerpc64le-linux; also verified using
> > > the ABI compat suite (against an unpatched GCC) that this patch does
> > > not change the ABI.
> > 
> > this causes PR libobjc/61920, link failures with -lobjc.
> 
> Try this.
> 
> Index: libobjc/encoding.c
> ===================================================================
> --- libobjc/encoding.c	(revision 213090)
> +++ libobjc/encoding.c	(working copy)
> @@ -192,6 +192,7 @@
>     ? MAX (MAX (COMPUTED, SPECIFIED), 64)				\
>     : MAX (COMPUTED, SPECIFIED));})
>  
> +#define rs6000_special_adjust_field_align_p false
>  
>  /* Skip a variable name, enclosed in quotes (").  */
>  static inline

Blah, that won't work of course.  The macro needs to take two
parameters.

#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) false

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-27 11:59     ` Alan Modra
@ 2014-07-27 12:31       ` pinskia
  2014-07-27 13:18         ` Matthias Klose
  0 siblings, 1 reply; 11+ messages in thread
From: pinskia @ 2014-07-27 12:31 UTC (permalink / raw)
  To: Alan Modra; +Cc: Matthias Klose, Ulrich Weigand, gcc-patches, dje.gcc



> On Jul 27, 2014, at 4:53 AM, Alan Modra <amodra@gmail.com> wrote:
> 
>> On Sun, Jul 27, 2014 at 07:16:07PM +0930, Alan Modra wrote:
>>> On Sat, Jul 26, 2014 at 01:45:12PM +0200, Matthias Klose wrote:
>>> Am 17.07.2014 02:41, schrieb Ulrich Weigand:
>>>> Hello,
>>>> 
>>>> this is the variant intended for the 4.8/4.9 branches of the patch:
>>>> https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
>>>> 
>>>> As discussed, it does *not* actually change ABI, but only warn when
>>>> encountering a situation where the ABI will change in a future GCC.
>>>> (Avoiding the specific term "GCC 4.10" here since I'm not certain
>>>> whether the next GCC release will in fact be called that ...)
>>>> 
>>>> Tested on powerpc64-linux and powerpc64le-linux; also verified using
>>>> the ABI compat suite (against an unpatched GCC) that this patch does
>>>> not change the ABI.
>>> 
>>> this causes PR libobjc/61920, link failures with -lobjc.
>> 
>> Try this.
>> 
>> Index: libobjc/encoding.c
>> ===================================================================
>> --- libobjc/encoding.c    (revision 213090)
>> +++ libobjc/encoding.c    (working copy)
>> @@ -192,6 +192,7 @@
>>    ? MAX (MAX (COMPUTED, SPECIFIED), 64)                \
>>    : MAX (COMPUTED, SPECIFIED));})
>> 
>> +#define rs6000_special_adjust_field_align_p false
>> 
>> /* Skip a variable name, enclosed in quotes (").  */
>> static inline
> 
> Blah, that won't work of course.  The macro needs to take two
> parameters.
> 
> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) false

This is pre-approved if it works.  I really should finish off the branch I started years ago :). 

Thanks,
Andrew

> 
> -- 
> Alan Modra
> Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-27 12:31       ` pinskia
@ 2014-07-27 13:18         ` Matthias Klose
  2014-07-28  2:07           ` Alan Modra
  2014-07-28 12:09           ` Ulrich Weigand
  0 siblings, 2 replies; 11+ messages in thread
From: Matthias Klose @ 2014-07-27 13:18 UTC (permalink / raw)
  To: pinskia, Alan Modra; +Cc: Ulrich Weigand, gcc-patches, dje.gcc

Am 27.07.2014 13:59, schrieb pinskia@gmail.com:
> 
> 
>> On Jul 27, 2014, at 4:53 AM, Alan Modra <amodra@gmail.com> wrote:
>>
>>> On Sun, Jul 27, 2014 at 07:16:07PM +0930, Alan Modra wrote:
>>>> On Sat, Jul 26, 2014 at 01:45:12PM +0200, Matthias Klose wrote:
>>>> Am 17.07.2014 02:41, schrieb Ulrich Weigand:
>>>>> Hello,
>>>>>
>>>>> this is the variant intended for the 4.8/4.9 branches of the patch:
>>>>> https://gcc.gnu.org/ml/gcc-patches/2014-07/msg01072.html
>>>>>
>>>>> As discussed, it does *not* actually change ABI, but only warn when
>>>>> encountering a situation where the ABI will change in a future GCC.
>>>>> (Avoiding the specific term "GCC 4.10" here since I'm not certain
>>>>> whether the next GCC release will in fact be called that ...)
>>>>>
>>>>> Tested on powerpc64-linux and powerpc64le-linux; also verified using
>>>>> the ABI compat suite (against an unpatched GCC) that this patch does
>>>>> not change the ABI.
>>>>
>>>> this causes PR libobjc/61920, link failures with -lobjc.
>>>
>>> Try this.
>>>
>>> Index: libobjc/encoding.c
>>> ===================================================================
>>> --- libobjc/encoding.c    (revision 213090)
>>> +++ libobjc/encoding.c    (working copy)
>>> @@ -192,6 +192,7 @@
>>>    ? MAX (MAX (COMPUTED, SPECIFIED), 64)                \
>>>    : MAX (COMPUTED, SPECIFIED));})
>>>
>>> +#define rs6000_special_adjust_field_align_p false
>>>
>>> /* Skip a variable name, enclosed in quotes (").  */
>>> static inline
>>
>> Blah, that won't work of course.  The macro needs to take two
>> parameters.
>>
>> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) false
> 
> This is pre-approved if it works.  I really should finish off the branch I started years ago :). 

#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) 0

is what succeeds for me. false is not defined for ObjC. Checked in on the trunk
and the branches.

these are still regressions, because the new warnings trigger on these test cases:

Running
/home/doko/gcc/gcc-4.9-4.9.1/src/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
...
FAIL: objc.dg-struct-layout-encoding-1/t025_main.m execution test
FAIL: objc.dg-struct-layout-encoding-1/t027_main.m execution test
FAIL: objc.dg-struct-layout-encoding-1/t028_main.m execution test
FAIL: objc.dg-struct-layout-encoding-1/t029_main.m execution test
FAIL: objc.dg-struct-layout-encoding-1/t030_main.m execution test
FAIL: objc.dg-struct-layout-encoding-1/t031_main.m execution test

No regressions in the obj-c++ tests.

  Matthias

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-27 13:18         ` Matthias Klose
@ 2014-07-28  2:07           ` Alan Modra
  2014-07-28 12:09           ` Ulrich Weigand
  1 sibling, 0 replies; 11+ messages in thread
From: Alan Modra @ 2014-07-28  2:07 UTC (permalink / raw)
  To: Matthias Klose; +Cc: pinskia, Ulrich Weigand, gcc-patches, dje.gcc

On Sun, Jul 27, 2014 at 03:16:03PM +0200, Matthias Klose wrote:
> >> Blah, that won't work of course.  The macro needs to take two
> >> parameters.
> >>
> >> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) false
> > 
> > This is pre-approved if it works.  I really should finish off the branch I started years ago :). 
> 
> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) 0
> 
> is what succeeds for me. false is not defined for ObjC. Checked in on the trunk
> and the branches.

Heh, that's what I found this morning too, when checking the bootstrap
I'd fired off after posting the "correction".

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields
  2014-07-27 13:18         ` Matthias Klose
  2014-07-28  2:07           ` Alan Modra
@ 2014-07-28 12:09           ` Ulrich Weigand
  2014-07-28 15:01             ` [commit, 4.8/4.9, libobjc] Match branch ABI (Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields) Ulrich Weigand
  1 sibling, 1 reply; 11+ messages in thread
From: Ulrich Weigand @ 2014-07-28 12:09 UTC (permalink / raw)
  To: Matthias Klose; +Cc: pinskia, Alan Modra, gcc-patches, dje.gcc

Matthias Klose wrote:

> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) 0
> 
> is what succeeds for me. false is not defined for ObjC. Checked in on the trunk
> and the branches.

Since we didn't backport the actual ABI change to the branches, only the warning,
I think it would be consistent to use something like this on the branches:

#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
  (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)

rather than the #define ... 0 that is appropriate for mainline.

> these are still regressions, because the new warnings trigger on these test cases:
> 
> Running
> /home/doko/gcc/gcc-4.9-4.9.1/src/gcc/testsuite/objc.dg/gnu-encoding/gnu-encoding.exp
> ...
> FAIL: objc.dg-struct-layout-encoding-1/t025_main.m execution test
> FAIL: objc.dg-struct-layout-encoding-1/t027_main.m execution test
> FAIL: objc.dg-struct-layout-encoding-1/t028_main.m execution test
> FAIL: objc.dg-struct-layout-encoding-1/t029_main.m execution test
> FAIL: objc.dg-struct-layout-encoding-1/t030_main.m execution test
> FAIL: objc.dg-struct-layout-encoding-1/t031_main.m execution test

This is strange; I'm not seeing these test FAIL.  (I do see the warning in the
log, just as with the C and C++ tests, but the warning is filtered out by the
dejagnu scripts and doesn't cause failures).

However, I've been testing with the above version of the macro, not sure if
that explains the difference.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [commit, 4.8/4.9, libobjc] Match branch ABI (Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields)
  2014-07-28 12:09           ` Ulrich Weigand
@ 2014-07-28 15:01             ` Ulrich Weigand
  0 siblings, 0 replies; 11+ messages in thread
From: Ulrich Weigand @ 2014-07-28 15:01 UTC (permalink / raw)
  To: Ulrich Weigand; +Cc: Matthias Klose, pinskia, Alan Modra, gcc-patches, dje.gcc

> Matthias Klose wrote:
> 
> > #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) 0
> > 
> > is what succeeds for me. false is not defined for ObjC. Checked in on the trunk
> > and the branches.
> 
> Since we didn't backport the actual ABI change to the branches, only the warning,
> I think it would be consistent to use something like this on the branches:
> 
> #define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
>   (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
> 
> rather than the #define ... 0 that is appropriate for mainline.

I've now checked this in to the 4.8 and 4.9 branches.
Tested on powerpc64le-linux.

Bye,
Ulrich


libobjc/

	PR libobjc/61920
	* encoding.c (rs6000_special_adjust_field_align_p): Use definition
	that matches the 4.8/4.9 branch ABI.

Index: libobjc/encoding.c
===================================================================
--- libobjc/encoding.c	(revision 213124)
+++ libobjc/encoding.c	(working copy)
@@ -192,7 +192,8 @@
    ? MAX (MAX (COMPUTED, SPECIFIED), 64)				\
    : MAX (COMPUTED, SPECIFIED));})
 
-#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) 0
+#define rs6000_special_adjust_field_align_p(FIELD, COMPUTED) \
+ (TARGET_ALTIVEC && TREE_CODE (TREE_TYPE (FIELD)) == VECTOR_TYPE)
 
 /* Skip a variable name, enclosed in quotes (").  */
 static inline


-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-28 14:50 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17  0:42 [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields Ulrich Weigand
2014-07-18 16:11 ` David Edelsohn
2014-07-18 16:51   ` Jakub Jelinek
2014-07-26 12:08 ` Matthias Klose
2014-07-27  9:51   ` Alan Modra
2014-07-27 11:59     ` Alan Modra
2014-07-27 12:31       ` pinskia
2014-07-27 13:18         ` Matthias Klose
2014-07-28  2:07           ` Alan Modra
2014-07-28 12:09           ` Ulrich Weigand
2014-07-28 15:01             ` [commit, 4.8/4.9, libobjc] Match branch ABI (Re: [PATCH, rs6000, 4.8/4.9] Fix alignment of non-Altivec vector struct fields) Ulrich Weigand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).