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] m68k: Fix binary compatibility problem with -mno-strict-align. (Take 2)


Roman Zippel wrote:

Looking at this a little closer, I'm not sure why this is related to alignment in first place. Whether a structure is returned in a register should be controlled by -fpcc-struct-return/-freg-struct-return and the DEFAULT_PCC_STRUCT_RETURN value in the config. In function.c:aggregate_value_p there is shortly after the return_in_memory hook the following test:

  if (flag_pcc_struct_return && AGGREGATE_TYPE_P (type))
    return 1;

IMO the alignment should have no influence here, so where is this coming from?

store layout sets the mode of a structure depending on STRICT_ALIGNMENT. For instance a {short, short} struct will get SI mode if STRICT_ALIGNMENT is false. When it's true such a struct will get BLKmode. The default can-return-in-reg hook examines the type's mode. If it's BLKmode, it is returned in memory, if it's an integral mode it is returned in a register.


nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery


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