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]

assign_stack_local (and friends) alignment issue


Currently assign_stack_local and assign_outer_stack_local are
passed the mode, size, and desired alignment for the new variable.
And assign_stack_temp is passed the mode and size for the new
variable.  This works okay for:

  double a

however this isn't sufficient information to determine the desired
alignment for more complicated types.  For example:

  double a[10]

on the i386 results in:

#0 assign_stack_local (mode=BLKmode, size=80, align=-1) at function.c:717
#1 0x28b58 in assign_stack_temp (mode=BLKmode, size=80, keep=1)
    at function.c:933
#2 0x35d8f in expand_decl (decl=0x1fd970) at stmt.c:3415

Ideally assign_stack_temp / assign_stack_local should have more
information so that something like the DATA_ALIGNMENT macro could
be used which understands that on the i386 an array of doubles
should have at least 64 bits (actually in this specific case 256
bits) of alignment.  This could be accomplished by changing
assign_stack_local / assign_outer_stack_local / assign_stack_temp
to take the decl tree as a parameter (this involves changing a lot
of callers), or by creating new functions which takes the decl tree,
changing the old assign_stack functions to use the new ones, and changing
expand_decl to call the new assign_stack_temp function.

Thoughts?

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------


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