* [Patch libobjc] Fix Darwin powerpc m64 breakage.
@ 2010-07-03 10:55 IainS
2010-08-13 13:09 ` repost, " Office Admin
0 siblings, 1 reply; 4+ messages in thread
From: IainS @ 2010-07-03 10:55 UTC (permalink / raw)
To: GCC Patches; +Cc: Andrew Pinski, mrs
it's nice when 4 lines of code fixes 4 dozen test-suite fails ..
.. and disappointing that it's probably taken more than 4 years for
someone to have time to look ..
Andrew, I realize that this doesn't in any way alter the 'broken-ness'
of the current design - but, on the other hand, it does make powerpc-
apple-darwin9 work @m64 within that current design. [... and gets rid
of a bunch of test-suite fail output for those of us who test powerpc
@m64].
FWIW, actually fixing m32 might be somewhat more taxing since that
involves replication of the xxx_special_round_type_align () functions
(which have drifted away from the implementation in encode.c.).
I had a quick scan but didn't see any specific PR to put this against...
OK for trunk?
Iain
libobjc/Changelog:
* encoding.c: Add TARGET_ALIGN_NATURAL definition for m64 powerpc
darwin.
Add a comment as to why, update FIXME comments.
testsuite/ChangeLog:
* objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c: Update
XFAILs.
Index: libobjc/encoding.c
===================================================================
--- libobjc/encoding.c (revision 161768)
+++ libobjc/encoding.c (working copy)
@@ -105,10 +105,22 @@ static int __attribute__ ((__unused__)) not_target
#undef ALTIVEC_VECTOR_MODE
#define ALTIVEC_VECTOR_MODE(MODE) (0)
+/* Furthermore, some (powerpc) targets also use TARGET_ALIGN_NATURAL
+ in their alignment macros. Currently[4.5/6], rs6000.h points this
+ to a static variable, initialized by target overrides. This is
reset
+ in linux64.h but not in darwin64.h and therefore, all the darwin64
+ stuff is broken. This echoes the comments above and below about
+ the badness of the approach. Other powerpc64 targets might also
+ be affected. */
+
+#if defined(DEFAULT_ABI) && (DEFAULT_ABI==ABI_DARWIN) && __LP64__
+# undef TARGET_ALIGN_NATURAL
+# define TARGET_ALIGN_NATURAL 1
+#endif
/* FIXME: while this file has no business including tm.h, this
definitely has no business defining this macro but it
- is only way around without really rewritting this file,
+ is only way around without really rewriting this file,
should look after the branch of 3.4 to fix this. */
#define rs6000_special_round_type_align(STRUCT, COMPUTED, SPECIFIED) \
({ const char *_fields = TYPE_FIELDS (STRUCT); \
@@ -116,8 +128,12 @@ static int __attribute__ ((__unused__)) not_target
&& TYPE_MODE (strip_array_types (TREE_TYPE (_fields))) ==
DFmode) \
? MAX (MAX (COMPUTED, SPECIFIED), 64) \
: MAX (COMPUTED, SPECIFIED));})
+
/* FIXME: The word 'fixme' is insufficient to explain the wrong-ness
- of this next macro definition. */
+ of this next macro definition.
+ FIXME1: It's also out of date, darwin no longer has the same
alignment
+ 'special' as aix - this is probably the origin of the m32
breakage, since
+ the 'special' routine is not used at m64 with
TARGET_ALIGN_NATURAL=1. */
#define darwin_rs6000_special_round_type_align(S,C,S2) \
rs6000_special_round_type_align(S,C,S2)
Index: gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c
===================================================================
--- gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c (revision 161768)
+++ gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c (working copy)
@@ -236,7 +236,7 @@ switchfiles (int fields)
|| filecnt == 22)
{
fprintf (outfile, "\
-/* { dg-do run { xfail powerpc*-*-darwin* powerpc*-*-aix* } } */\n\
+/* { dg-do run { xfail { { \"powerpc*-*-darwin*\" && { ! lp64 } } ||
{ \"powerpc*-*-aix*\" } } } } */\n\
/* { dg-options \"-w -I%s -fgnu-runtime\" } */\n", srcdir);
}
/* FIXME: these should not be xfailed but they are because
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: repost, [Patch libobjc] Fix Darwin powerpc m64 breakage.
2010-07-03 10:55 [Patch libobjc] Fix Darwin powerpc m64 breakage IainS
@ 2010-08-13 13:09 ` Office Admin
2010-08-27 18:45 ` Andrew Pinski
0 siblings, 1 reply; 4+ messages in thread
From: Office Admin @ 2010-08-13 13:09 UTC (permalink / raw)
To: Andrew Pinski; +Cc: GCC Patches, mrs
Andrew,
A repost after our discussion on irc,
OK for trunk now?
Iain
On 3 Jul 2010, at 11:54, IainS wrote:
> it's nice when 4 lines of code fixes 4 dozen test-suite fails ..
> .. and disappointing that it's probably taken more than 4 years for
> someone to have time to look ..
Now that the PPC64 ABI is fixed on darwin I'd like to get this in
too....
> libobjc/Changelog:
>
> * encoding.c: Add TARGET_ALIGN_NATURAL definition for m64 powerpc
> darwin.
> Add a comment as to why, update FIXME comments.
>
> testsuite/ChangeLog:
>
> * objc.dg/gnu-encoding/struct-layout-encoding-1_generate.c: Update
> XFAILs.
>
Index: libobjc/encoding.c
===================================================================
--- libobjc/encoding.c (revision 163223)
+++ libobjc/encoding.c (working copy)
@@ -105,13 +105,24 @@ static int __attribute__ ((__unused__)) not_target
#undef ALTIVEC_VECTOR_MODE
#define ALTIVEC_VECTOR_MODE(MODE) (0)
+/* Furthermore, some (powerpc) targets also use TARGET_ALIGN_NATURAL
+ in their alignment macros. Currently[4.5/6], rs6000.h points this
+ to a static variable, initialized by target overrides. This is reset
+ in linux64.h but not in darwin64.h. The macro is not used by *86*.
*/
+#if __MACH__ && __LP64__
+# undef TARGET_ALIGN_NATURAL
+# define TARGET_ALIGN_NATURAL 1
+#endif
+
/* FIXME: while this file has no business including tm.h, this
definitely has no business defining this macro but it
is only way around without really rewritting this file,
- should look after the branch of 3.4 to fix this. */
+ should look after the branch of 3.4 to fix this.
+ FIXME1: It's also out of date, darwin no longer has the same
alignment
+ 'special' as aix - this is probably the origin of the m32
breakage. */
#define rs6000_special_round_type_align(STRUCT, COMPUTED,
SPECIFIED) \
- ({ const char *_fields = TYPE_FIELDS
(STRUCT); \
+ ({ const char *_fields = TYPE_FIELDS
(STRUCT); \
((_fields !=
0 \
&& TYPE_MODE (strip_array_types (TREE_TYPE (_fields))) ==
DFmode) \
? MAX (MAX (COMPUTED, SPECIFIED),
64) \
Index: gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c
===================================================================
--- gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c (revision 163223)
+++ gcc/testsuite/objc.dg/gnu-encoding/struct-layout-
encoding-1_generate.c (working copy)
@@ -236,7 +236,7 @@ switchfiles (int fields)
|| filecnt == 22)
{
fprintf (outfile, "\
-/* { dg-do run { xfail powerpc*-*-darwin* powerpc*-*-aix* } } */\n\
+/* { dg-do run { xfail { { \"powerpc*-*-darwin*\" && { ! lp64 } } ||
{ \"powerpc*-*-aix*\" } } } } */\n\
/* { dg-options \"-w -I%s -fgnu-runtime\" } */\n", srcdir);
}
/* FIXME: these should not be xfailed but they are because
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: repost, [Patch libobjc] Fix Darwin powerpc m64 breakage.
2010-08-13 13:09 ` repost, " Office Admin
@ 2010-08-27 18:45 ` Andrew Pinski
2010-09-06 9:58 ` IainS
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Pinski @ 2010-08-27 18:45 UTC (permalink / raw)
To: Office Admin; +Cc: GCC Patches, mrs
On Fri, Aug 13, 2010 at 5:32 AM, Office Admin <admin-sal@btconnect.com> wrote:
> Andrew,
> A repost after our discussion on irc,
> OK for trunk now?
Yes this is ok.
Thanks,
Andrew Pinski
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-09-06 9:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-03 10:55 [Patch libobjc] Fix Darwin powerpc m64 breakage IainS
2010-08-13 13:09 ` repost, " Office Admin
2010-08-27 18:45 ` Andrew Pinski
2010-09-06 9:58 ` IainS
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).