]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (rs6000_override_options): Default to natural alignment for 64-bit Darwin.
authorStan Shebs <shebs@apple.com>
Tue, 22 Feb 2005 23:38:02 +0000 (23:38 +0000)
committerStan Shebs <shebs@gcc.gnu.org>
Tue, 22 Feb 2005 23:38:02 +0000 (23:38 +0000)
        * config/rs6000/rs6000.c (rs6000_override_options): Default to
        natural alignment for 64-bit Darwin.
        (rs6000_parse_alignment_option): Warn about uses of -malign-power
        on 64-bit Darwin.
        * doc/invoke.texi: Document this.

From-SVN: r95420

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/doc/invoke.texi

index 5af7fb69356bfa12e29ffe2a62b57a0ac07a8780..a8d9d5a174d1dcc384ea49473b9366969a4c1289 100644 (file)
@@ -1,3 +1,11 @@
+2005-02-22  Stan Shebs  <shebs@apple.com>
+
+       * config/rs6000/rs6000.c (rs6000_override_options): Default to
+       natural alignment for 64-bit Darwin.
+       (rs6000_parse_alignment_option): Warn about uses of -malign-power
+       on 64-bit Darwin.
+       * doc/invoke.texi: Document this.
+
 2005-02-22  DJ Delorie  <dj@redhat.com>
 
        * c-common.c (c_common_type_for_mode): Pass the mode's precision
index 267a16131d13427e3180c9e22aea04f713c55aae..ea5c0108413ff8a20d26304b7a939bb5841ea770 100644 (file)
@@ -1316,6 +1316,8 @@ rs6000_override_options (const char *default_cpu)
 #if TARGET_MACHO
       darwin_one_byte_bool = "";
 #endif
+      /* Default to natural alignment, for better performance.  */
+      rs6000_alignment_flags = MASK_ALIGN_NATURAL;
     }
 
   /* Handle -mabi= options.  */
@@ -1684,7 +1686,16 @@ rs6000_parse_alignment_option (void)
   if (rs6000_alignment_string == 0)
     return;
   else if (! strcmp (rs6000_alignment_string, "power"))
-    rs6000_alignment_flags = MASK_ALIGN_POWER;
+    {
+      /* On 64-bit Darwin, power alignment is ABI-incompatible with
+        some C library functions, so warn about it. The flag may be
+        useful for performance studies from time to time though, so
+        don't disable it entirely.  */
+      if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT)
+       warning ("-malign-power is not supported for 64-bit Darwin;"
+                " it is incompatible with the installed C and C++ libraries");
+      rs6000_alignment_flags = MASK_ALIGN_POWER;
+    }
   else if (! strcmp (rs6000_alignment_string, "natural"))
     rs6000_alignment_flags = MASK_ALIGN_NATURAL;
   else
index ad8ee654c68906b59bcebd2211a7db428178a971..6f13ecac5eeb9c0a418f8435457f5b0830eb6e50 100644 (file)
@@ -10528,12 +10528,15 @@ option are incompatible.
 @itemx -malign-power
 @opindex malign-natural
 @opindex malign-power
-On AIX, Darwin, and 64-bit PowerPC GNU/Linux, the option
+On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
 @option{-malign-natural} overrides the ABI-defined alignment of larger
 types, such as floating-point doubles, on their natural size-based boundary.
 The option @option{-malign-power} instructs GCC to follow the ABI-specified
 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
 
+On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
+is not supported.
+
 @item -msoft-float
 @itemx -mhard-float
 @opindex msoft-float