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: fix execute/20020412-1.c


>These small structs have been incorrectly padded on the left for
>a long time on the 32-bit PA port because there is no way to specify
>padding on the right using FUNCTION_ARG_PADDING when the size of
>a BLKmode type is wider than a word.

You should be able to solve this problem by making function_arg return a
PARALLEL instead of a plain REG.  A PARALLEL value is handled by
emit_group_{load,store}, which will always left-justify for big-endian
and right-justify for little-endian.  That sounds like the behaviour you
want.  In contrast, if you return a REG, you always get right-justified
values for both big and little endian.

There are a number of targets using PARALLEL values that you can look at
for examples.  The sparc port has a good one, though it may be a tad more
complicated than what you need.

Ideally, the PARALLEL stuff should also have a field indicating whether
we want left-justified or right-justified values, so that all targets can
use it always.  At the moment, we can handle most targets OK since you can
get left-justified big-endian by using a PARALLEL, and right-justified
big-endian by using a REG.  You can only get right-justified for little-endian
targets.  If you need both kinds of justification, or left-justification
for big-endian, then you are screwed.  IA-64 falls in this category.

Jim


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