ix86_data_alignment: bad defaults?

DJ Delorie dj@redhat.com
Fri Feb 23 00:34:00 GMT 2007


> It is to improve performance of string functions on larger chunks of
> data.  x86-64 specify this, for x86 it is optional.  I don't think we
> should end up warning here - it is done only for static variables where
> the alignment can be higher than what BIGGEST_ALIGNMENT promise.

Higher than BIGGEST_ALIGNMENT?  So, maybe we should rename it
ALMOST_BIGGEST_ALIGNMENT?  I'm confused.

The alignment warning came from varasm.c align_variable():

  /* Some object file formats have a maximum alignment which they support.
     In particular, a.out format supports a maximum alignment of 4.  */
  if (align > MAX_OFILE_ALIGNMENT)
    {
      warning (0, "alignment of %q+D (%d) is greater than maximum object "
               "file alignment.  Using %d", decl,
	       align / BITS_PER_UNIT,
	       MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
      align = MAX_OFILE_ALIGNMENT;
    }

In the failing case, MAX_OFILE_ALIGNMENT is 128 (it defaults to
BIGGEST_ALIGNMENT).

Failing code looks like this:

unsigned short __dj_ctype_flags[] = {
  0,							/* CTRL+?, 0xffff */
  __dj_ISCNTRL,						/* CTRL+@, 0x00 */
  . . .
};



More information about the Gcc mailing list