This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Natural alignment for 64-bit Darwin


Richard Henderson wrote:

On Tue, Feb 22, 2005 at 04:54:32PM -0800, Stan Shebs wrote:

  else if (! strcmp (rs6000_alignment_string, "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;
!     }


A silly and pointless warning. As with any abi-changing switch, changing the default is dangerous for ALL targets. Why ever did you think that darwin was special in this regard?

As it happens, in the 32-bit Darwin world -malign-natural usually
works, and performance hounds have been known to use the flag and
get good results. Natural alignment there mostly only affects
structs with embedded doubles, and I'm not sure there are even
any of those in Darwin's standard libraries.

Conversely, in the 64-bit Darwin world, the size and offsets of
fields in FILE and many other standard structs change with the
alignment change, so a formerly semi-safe option is quite a bit
more hazardous than it used to be.

I think users would really like GCC to warn them in general
about ABI-changing options; whenever I talk to them, they
are always unsure about what is safe to fool with and what
is not - one of those "snake pit in the middle of the living
room floor" situations that GCC is infamous for.

Stan



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]