re PR target/25299 (Another ABI incompatibility with Apple's gcc)
authorAlan Modra <amodra@bigpond.net.au>
Mon, 12 Dec 2005 01:28:50 +0000 (01:28 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Mon, 12 Dec 2005 01:28:50 +0000 (11:58 +1030)
PR target/25299
* config/rs6000/rs6000.c (rs6000_special_round_type_align): Increase
alignment to doubleword if the first field is a double array.
* config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define.

From-SVN: r108393

gcc/ChangeLog
gcc/config/rs6000/linux64.h
gcc/config/rs6000/rs6000.c

index 47d19ac89a82b6cc4a55429389d5b9927483b04b..1e602a212a4ae26328b15d03604fe838fc2ab92f 100644 (file)
@@ -1,3 +1,10 @@
+2005-12-12  Alan Modra  <amodra@bigpond.net.au>
+
+       PR target/25299
+       * config/rs6000/rs6000.c (rs6000_special_round_type_align): Increase
+       alignment to doubleword if the first field is a double array.
+       * config/rs6000/linux64.h (TARGET_ALIGN_NATURAL): Define.
+
 2005-12-11  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-structalias.c (process_constraint): Remove code to
index 1555d2968a7f4ba547bfec23c1c9f0716d7f5b41..bc615e8c96d16ecb7f43f87967612ad378e22cea 100644 (file)
@@ -236,6 +236,12 @@ extern int dot_symbols;
    ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED)     \
    : MAX ((COMPUTED), (SPECIFIED)))
 
+/* Use the default for compiling target libs.  */
+#ifdef IN_TARGET_LIBS
+#undef TARGET_ALIGN_NATURAL
+#define TARGET_ALIGN_NATURAL 1
+#endif
+
 /* Indicate that jump tables go in the text section.  */
 #undef  JUMP_TABLES_IN_TEXT_SECTION
 #define JUMP_TABLES_IN_TEXT_SECTION TARGET_64BIT
index 609de947d3e0f5fc5ce43576dcd6c1becbb2c4ae..9f547dab057759314f189416e883f80cfa8292c4 100644 (file)
@@ -2513,7 +2513,10 @@ rs6000_special_round_type_align (tree type, int computed, int specified)
   while (field != NULL && TREE_CODE (field) != FIELD_DECL)
     field = TREE_CHAIN (field);
 
-  if (field == NULL || field == type || DECL_MODE (field) != DFmode)
+  if (field == NULL || field == type
+      || TYPE_MODE (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE
+                   ? get_inner_array_type (field)
+                   : TREE_TYPE (field)) != DFmode)
     return MAX (computed, specified);
 
   return MAX (MAX (computed, specified), 64);