This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: fix execute/20020412-1.c
- From: Jim Wilson <wilson at redhat dot com>
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org, joern dot rennecke at superh dot com, rth at redhat dot com
- Date: 05 Sep 2002 11:38:31 -0400
- Subject: Re: fix execute/20020412-1.c
- References: <200209042143.g84Lh1Ai012083@hiauly1.hia.nrc.ca>
>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