public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [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
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamanonymous.cs at gmail dot com

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112605 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
  2023-11-18 19:48 ` [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack 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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-19  0:45 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com
             Status|NEW                         |ASSIGNED

--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 56637
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56637&action=edit
Proposed patch

Patch that implements ideas from Comment 7 and Comment 8.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
  2023-11-18 19:48 ` [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack 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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-19 18:11 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #56637|0                           |1
        is obsolete|                            |

--- Comment #13 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 56647
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56647&action=edit
Proposed patch v2

New version, also fixes "-fsplit-stack -fpic -mforce-indirect-call" on 32-bit
targets.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  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
  2023-11-23 15:21 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-20 16:43 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
Patch at [1].

[1] https://gcc.gnu.org/pipermail/gcc-patches/2023-November/637478.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2023-11-20 16:43 ` ubizjak at gmail dot com
@ 2023-11-23 15:09 ` cvs-commit at gcc dot gnu.org
  2023-11-23 15:21 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-11-23 15:09 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack
       [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2023-11-23 15:09 ` cvs-commit at gcc dot gnu.org
@ 2023-11-23 15:21 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2023-11-23 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |14.0
         Resolution|---                         |FIXED

--- Comment #16 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed for gcc-14.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-23 15:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-89316-4@http.gcc.gnu.org/bugzilla/>
2023-11-18 19:48 ` [Bug target/89316] ICE with -mforce-indirect-call and -fsplit-stack 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
2023-11-23 15:21 ` ubizjak at gmail dot com

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).