public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Marc Lehmann <pcg@goof.com>
Cc: egcs@cygnus.com
Subject: Re: [EGCS] Re: double alignment patch for x86
Date: Mon, 09 Feb 1998 02:10:00 -0000	[thread overview]
Message-ID: <5765.887019104@hurl.cygnus.com> (raw)
In-Reply-To: <E0x0rGY-0000Z1-00.1997-08-19-18-36-22_pgcc_forever_@cerebro>

  In message <E0x0rGY-0000Z1-00.1997-08-19-18-36-22_pgcc_forever_@cerebro>you write:
  > One thing that bugs me for months now (need advice):
  > 
  > gcc currently ignores the alignment set by FUNCTION_ARG_BOUNDARY
  > on machines that use push instructions to store arguments. This
  > results in incorrect code (caller forgets the necessary padding)
  > with the proposed -marg-align-double.
Right.

  > I'd like to fix this... so... where would be the place to do that?
  > Should store_one_arg add padding, or should this be done in expand_call?
Have the caller push dummy word(s) before any of the normal args iff the
sum total of the stack area to be pushed is not a multiple of
FUNCTION_ARG_BOUNDARY.

The callee then moves any unaligned args out of the stack into either a
register (if that't the final "home" for the arg) or into an aligned
stack slot.

However, this only works if nobody ever mis-aligns the stack -- which
is hard to guarantee on the x86 because of the existance of old compilers
which do not maintain proper stack alignment.


  > We could make the switch dependent on the OS (Linux -> do, solaris ->
  > ignore).  That's somewhat ugly, but it doesn't break any programs.
You can't even do it on linux by default because of existing libraries
which may perform callbacks (qsort) or the need to be able to mix and
match .o files from different versions of gcc.


jeff

  reply	other threads:[~1998-02-09  2:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-19 19:45 Marc Lehmann
1998-02-09  2:10 ` Jeffrey A Law [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-08-18  8:22 2 (small?) problems Thomas Hiller
1997-08-18 13:29 ` [EGCS] Re: double alignment patch for x86 Dave Love
1997-08-17 21:48 Toon Moene
1997-08-17 21:48 Marc Lehmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5765.887019104@hurl.cygnus.com \
    --to=law@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=pcg@goof.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).