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]

Re: RFA: alignment computed by get_inner_reference


Hi Richard,

: This patch is incorrect.  All alignments in RTL generation are now
: in bytes.  Which caller is expecting an alignment in bits?

get_best_mode() in stor-layout.c.  The exact call sequence is as
follows:

  expand_assignment() calls get_inner_reference () and gets an
  alignment back in bytes.

  expand_assignment() then calls store_field() which calls
  store_bit_field() which calls store()_fixed_bit_field() which calls
  get_best_mode().

Each of these functions leaves the alignment unchanged.  The comment
at the start of get_best_mode() says that the alignment should be in
bits.

I assumed that get_inner_reference is supposed to return an alignment
in bits because it initialise the variable 'alignment' to the value
BIGGEST_ALIGNMENT and this is a bit alignment, not a byte alignment.

Cheers
	Nick


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