From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BCC4F385DC02; Thu, 23 Nov 2023 15:09:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BCC4F385DC02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1700752145; bh=Wn0WmlVthTSm8OyQKuomD6aaJyp/u8aqidtxIU8Y7JY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cRS9VcPJO84RJGA1olPfx6cyIPjpZib246z30LXt/TqR/VXCRaLe/Q7Ay+qZXfm0o c4UVzjuj0/cGX4A/YkLa7IiXGEWOi+/IXQvyqSIvCTHO7mYmPXFQtvndvdPinSSHkD HCc2odoXKg0ADadWO0RsIq+I2UBQVuHS6MkRXAO4= From: "cvs-commit at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: ice-on-valid-code, patch X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ubizjak at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89316 --- Comment #15 from CVS Commits --- The master branch has been updated by Uros Bizjak : https://gcc.gnu.org/g:2f3f8952ff1736dd6a087ddb4106077db3502bb9 commit r14-5784-g2f3f8952ff1736dd6a087ddb4106077db3502bb9 Author: Uros Bizjak 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 va= lue 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=20 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.=