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: [patch, mips, tree] align microMIPS functions to 16 bits with -Os


On 06/04/2014 06:20 AM, Richard Biener wrote:
On Tue, 3 Jun 2014, Richard Sandiford wrote:

Richi suggested just changing the alignment at output time.  I assume
that would be a case of replacing the DECL_ALIGN in:

   /* Tell assembler to move to target machine's alignment for functions.  */
   align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
   if (align > 0)
     {
       ASM_OUTPUT_ALIGN (asm_out_file, align);
     }

with a hook.  (Is that right?)

Yeah, kind of.  Of course if DECL_ALIGN on function-decls is "unused"
then we may as well initialize it to 1 in tree.c and at an appropriate
stage adjust it to the result of a target hook invocation.

Appropriate stage would be the above place (which means DECL_ALIGN
is essentially "unused" for FUNCTION_DECLs).

So ... can you massage the DECL_ALIGN macro to ICE on FUNCTION_DECLs
and see where we access it?  (generic code will possibly trip on it,
but the question is is there any user that cares?)

Well, offhand, I know that one of the places is in handle_aligned_attribute, in c-common/c-common.c, where we handle user-specified alignment attributes. Here we are potentially both reading and writing the DECL_ALIGN field of a FUNCTION_DECL.

-Sandra


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