public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Lehmann <pcg@goof.com>
To: egcs@cygnus.com
Subject: Re: [EGCS] Re: double alignment patch for x86
Date: Tue, 19 Aug 1997 19:45:02 -0000	[thread overview]
Message-ID: <E0x0rGY-0000Z1-00.1997-08-19-18-36-22_pgcc_forever_@cerebro> (raw)
In-Reply-To: 10604.871961073@hurl.cygnus.com

>  > IMHO, the stack should always be aligned to an 8 byte boundary unless you
>  > specifically ask for it otherwise (-fspace for instance).  Otherwise, your
>  > caller may not have aligned the stack properly.
>That's one way to approach the problem, but it results in an extra insn to
>mask off the low bits of the stack in the prologue.

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.

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?

>Options which increase the minimum alignment requirements for stack objects
>implicitly depend on the OS, crt0 and friends to maintain proper 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.

In worst case we could simply default this switch to off.

>[ Which is why I would generally discourage options which work in this
>  manner. ]

I'd say we shouldn't discourage options that can easily double
code speed, with only minimal changes. And on many machines,
you have more alignment than the standard says anyway.

      -----==-
      ----==-- _
      ---==---(_)__  __ ____  __       Marc Lehmann
      --==---/ / _ \/ // /\ \/ /       pcg@goof.com
      -=====/_/_//_/\_,_/ /_/\_\
    The choice of a GNU generation

             reply	other threads:[~1997-08-19 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-19 19:45 Marc Lehmann [this message]
1998-02-09  2:10 ` Jeffrey A Law
  -- 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=E0x0rGY-0000Z1-00.1997-08-19-18-36-22_pgcc_forever_@cerebro \
    --to=pcg@goof.com \
    --cc=egcs@cygnus.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).