This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Align DImode to 4 byte for i386
- From: Jan Hubicka <jh at suse dot cz>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org, Richard Guenther <richard dot guenther at gmail dot com>, ubizjak at gmail dot com
- Date: Sun, 10 Feb 2008 00:44:57 +0100
- Subject: Re: PATCH: Align DImode to 4 byte for i386
- References: <20080204031135.GA7865@lucon.org> <84fc9c000802040159m22082326j37b09ec3ddf324a5@mail.gmail.com> <20080204110635.GD1757@kam.mff.cuni.cz> <84fc9c000802040309pd4ca9eag7a7cb1265943ee65@mail.gmail.com> <20080204112433.GB1026@kam.mff.cuni.cz> <20080204143842.GB10805@lucon.org> <20080204161849.GH1757@kam.mff.cuni.cz> <20080204165223.GA11416@lucon.org> <20080205022218.GA27992@atrey.karlin.mff.cuni.cz> <6dc9ffc80802090838t6e269d27h2989d5396a26266d@mail.gmail.com>
> Apparently, it breaks Ada. But Ada may be broken/different in long
> long alignment. I still believe
> my patch doesn't break the psABI.
I also agree that the patch can hardly break psABI when alignment of 4
is specified. The question is why it breaks Ada.
We used to have BIGGEST_ALIGNMENT set to 32. This was later revised to
support SSE modes and we now have BIGGEST_ALIGNMENT set to 128 and
ADJUST_FIELD_ALIGNMENT and friends responsible for reducing the
alignment of stuff to 32bit per psABI specification.
It seems to me that some of ABI stuff is not being adjusted as it ought.
Do you have any idea what breaks?
Honza
>
> H.J.
> On Feb 4, 2008 6:22 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > > Here is a patch. OK for 4.4 when it is opened?
> >
> > Seems OK. I hope there is no ABI breakage we missed.
> >
> > Honza
> >
> > >
> > > Thanks.
> > >
> > > H.J.
> > > --
> > > 2008-02-03 H.J. Lu <hongjiu.lu@intel.com>
> > >
> > > * config/i386/i386-modes.def: Use 4 byte alignment on DI in
> > > 32bit bit.
> > >
> > > Index: config/i386/i386-modes.def
> > > ===================================================================
> > > --- config/i386/i386-modes.def (revision 1470)
> > > +++ config/i386/i386-modes.def (working copy)
> > > @@ -17,6 +17,10 @@ You should have received a copy of the G
> > > along with GCC; see the file COPYING3. If not see
> > > <http://www.gnu.org/licenses/>. */
> > >
> > > +/* In 32bit, DI mode uses 32bit registers. Only 4 byte alignment
> > > + is needed. */
> > > +ADJUST_ALIGNMENT (DI, TARGET_64BIT ? 8 : 4);
> > > +
> > > /* The x86_64 ABI specifies both XF and TF modes.
> > > XFmode is __float80 is IEEE extended; TFmode is __float128
> > > is IEEE quad. */
> >