diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 13 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 5 |
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5af7fb6..a8d9d5a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 267a161..ea5c010 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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 diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ad8ee65..6f13eca 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 |