This is the mail archive of the gcc@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: Question about integer_asm_op()


I interpreted align_p as a guarantee of an alignment because of
my reading of the comment on line 1903

   object.  SIZE is the number of bytes in the object and ALIGNED_P
   indicates whether it is known to be aligned.  Return NULL if the
   
and because it is calculated in assemble_integer() as:

   aligned_p = (align >= MIN (size * BITS_PER_UNIT, BIGGEST_ALIGNMENT));
   
In this calculation, I could only make sense of it if "align" was an
alignment that the compiler could already guarantee.  Then if "align"
is greater than the size of the object or greater than the maximum
possible alignment required by the system, the compiler can state
that alignment is already satisfied.

I initially thought "align" in this calculation was a requested alignment.
But I could not understand why alignment is required only if the
requested alignment is greater than the size of the object or greater
than the largest alignment possibly required by the system.

In my particular case, I have a pointer of size==2, BITS_PER_UNIT==16,
align==16, and BIGGEST_ALIGNMENT==16.  Since BITS_PER_UNIT==BIGGEST_ALIGNMENT,
I would expect alignment to never be necessary, but in this case
aligned_p=1.

Hope this is clear.  Thanks for your help.

John Lu


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