This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: s390{,x} ABI incompatibility between gcc 4.0 and 4.1
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Joern RENNECKE <joern dot rennecke at st dot com>
- Cc: Richard Henderson <rth at redhat dot com>, Ulrich Weigand <uweigand at de dot ibm dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 29 Nov 2005 09:00:18 -0500
- Subject: Re: s390{,x} ABI incompatibility between gcc 4.0 and 4.1
- References: <20051128144923.GK31785@devserv.devel.redhat.com> <438C5B4C.7030007@st.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 29, 2005 at 01:44:44PM +0000, Joern RENNECKE wrote:
> No, it wasn't. The change was supposed to affect structures only.
> As I understand the documentation ,the expected behaviour would be to
> limit the alignment
> to BIGGEST_ALIGNMENT, unless the user has specified a larger alignment
> with the
> aligned attribute.
>
> One possible solution appears to be along the lines of
> http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stor-layout.c.diff?cvsroot=gcc&r1=1.239&r2=1.240
> ,
> but with the comment changed to explain what we want to preserve now.
>
> However, I think it is probably better to start out with the right
> alignment, by fix this code
> in layout_type to take BIGGEST_ALIGNMENT into account:
> case VECTOR_TYPE:
> ...
> /* Always naturally align vectors. This prevents ABI changes
> depending on whether or not native vector modes are
> supported. */
> TYPE_ALIGN (type) = tree_low_cst (TYPE_SIZE (type), 0);
If we use MIN (tree_low_cst (TYPE_SIZE (type), 0), BIGGEST_ALIGNMENT)
here, I'm afraid that would be much bigger ABI incompatibility.
Currently, say
typedef char __attribute__((vector_size (64))) v64qi;
is 64 bytes aligned on most arches, even when BIGGEST_ALIGNMENT is much
smaller.
GCC 4.0.x on s390{,x} aligned vector_size 1/2/4/8/64/128/... types
to their size, just vector_size 16 and 32 has been 8 bytes aligned
(BIGGEST_ALIGNMENT).
Not capping to BIGGEST_ALIGNMENT might have issues with some object formats
though, if they don't support ridiculously big aligments.
Jakub