public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/46094] New: -fsplit-stack doesn't honour x86_64 ABI wrt. stack alignment
Date: Wed, 20 Oct 2010 11:23:00 -0000	[thread overview]
Message-ID: <bug-46094-4@http.gcc.gnu.org/bugzilla/> (raw)

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46094

           Summary: -fsplit-stack doesn't honour x86_64 ABI wrt. stack
                    alignment
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


If I understand http://www.x86-64.org/documentation/abi.pdf correctly, and the
ABI described here is valid enough, -fsplit-stack doesn't align stack correctly
when calling functions.
At the moment of function entry, this should hold: (rsp&15)==8

As example, I will use the testcase from PR46093 (
http://gcc.gnu.org/bugzilla/attachment.cgi?id=22091 ). There are values of rsp
at the moment of function entry:

GDB breakpoints:
b main
b foo
b __morestack
b __morestack_block_signals
b __generic_morestack
b __morestack_unblock_signals
b __generic_releasestack
b pthread_sigmask
b sigprocmask

(for some reason, breakpoint at __morestack wasn't set correctly by this
procedure, so I had to set it manually)

function                    rsp
main                        0x7fffffffde58
__morestack                 0x7fffffffde50
__morestack_block_signals   0x7fffffffddf0
sigprocmask                 0x7fffffffddf0
__generic_morestack         0x7fffffffde00
__morestack_unblock_signals 0x7ffff7ff9ff8
sigprocmask                 0x7ffff7ff9ff8
foo                         0x7ffff7ff5fe8
...

this could cause problem if (for example) sigprocmask() used SSE instructions
to access stack


                 reply	other threads:[~2010-10-20 11:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=bug-46094-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).