public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
Date: Thu, 23 Nov 2023 15:09:02 +0000	[thread overview]
Message-ID: <bug-89316-4-4HbSnjTQaP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-89316-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89316

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:2f3f8952ff1736dd6a087ddb4106077db3502bb9

commit r14-5784-g2f3f8952ff1736dd6a087ddb4106077db3502bb9
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Thu Nov 23 15:45:59 2023 +0100

    i386: Fix ICE with -mforce-indirect-call and -fsplit-stack [PR89316]

    With the above two options, use a temporary register regno (as returned
    from split_stack_prologue_scratch_regno) as an indirect call scratch
    register to hold __morestack function address.  On 64-bit targets, two
    temporary registers are always available, so load the function addres in
    %r11 and call __morestack_large_model with its one-argument-register value
    rn %r10.  On 32-bit targets, bail out with a "sorry" if the temporary
    register can not be obtained.

    On 32-bit targets, also emit PIC sequence that re-uses the obtained
indirect
    call scratch register before moving the function address to it.  We can
    not set up %ebx PIC register in this case, but __morestack is prepared
    for this situation and sets it up by itself.

            PR target/89316

    gcc/ChangeLog:

            * config/i386/i386.cc (ix86_expand_split_stack_prologue): Obtain
            scratch regno when flag_force_indirect_call is set.  On 64-bit
            targets, call __morestack_large_model when 
flag_force_indirect_call
            is set and on 32-bit targets with -fpic, manually expand PIC
sequence
            to call __morestack.  Move the function address to an indirect
            call scratch register.

    gcc/testsuite/ChangeLog:

            * g++.target/i386/pr89316.C: New test.
            * gcc.target/i386/pr112605-1.c: New test.
            * gcc.target/i386/pr112605-2.c: New test.
            * gcc.target/i386/pr112605.c: New test.

  parent reply	other threads:[~2023-11-23 15:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
2023-11-18 19:48 ` pinskia at gcc dot gnu.org
2023-11-19  0:45 ` ubizjak at gmail dot com
2023-11-19 18:11 ` ubizjak at gmail dot com
2023-11-20 16:43 ` ubizjak at gmail dot com
2023-11-23 15:09 ` cvs-commit at gcc dot gnu.org [this message]
2023-11-23 15:21 ` ubizjak at gmail dot com

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-89316-4-4HbSnjTQaP@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).