From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3ED713858D35; Fri, 7 Aug 2020 03:03:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ED713858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1596769423; bh=r4YDgH4iTicV7FcNo4pi8Jjm6K/KzebKv1FKgi+wdHM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GOQIY9qVC6wfaaRXDfiHWSe/a4uedCYYJWnJ/45dea6w+3P27/1eVGEmSfLgiEAdP jm3h7zor9DglCRoLqUVjT3m6sXXnNoI8tkPISrlrfaP3RAmQTJXbXoWkAu9+CJL8v+ eXplFnUAZ1Fr0GsnELJIBXaTGTQh0bxwGS57e7OM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/96493] powerpc local call linkage failure Date: Fri, 07 Aug 2020 03:03:42 +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: 11.0 X-Bugzilla-Keywords: 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: amodra 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 03:03:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96493 --- Comment #3 from CVS Commits --- The master branch has been updated by Alan Modra : https://gcc.gnu.org/g:f8ac30f1653ff69706c35af6d725f1d330600f11 commit r11-2603-gf8ac30f1653ff69706c35af6d725f1d330600f11 Author: Alan Modra Date: Thu Aug 6 14:12:21 2020 +0930 PR96493, powerpc local call linkage failure This corrects current_file_function_operand, an operand predicate used to determine whether a symbol_ref is safe to use with the local_call patterns. Calls between pcrel and non-pcrel code need to go via linker stubs. In the case of non-pcrel code to pcrel the stub saves r2 but there needs to be a nop after the branch for the r2 restore. So the local_call patterns can't be used there. For pcrel code to non-pcrel the local_call patterns could still be used, but I thought it better to not use them since the call isn't direct. Code generated by the corresponding call_nonlocal_aix for pcrel is identical anyway. Incidentally, without the TREE_CODE () =3D=3D FUNCTION_DECL test, gcc.c-torture/compile/pr37433.c and pr37433-1.c ICE. Also, if you make the test more strict by disallowing an op without a SYMBOL_REF_DECL then a bunch of go and split-stack tests fail. That's because a prologue call to __morestack can't have a following nop. (__morestack calls its caller at a fixed offset from the __morestack call!) gcc/ PR target/96493 * config/rs6000/predicates.md (current_file_function_operand): Don't accept functions that differ in r2 usage. gcc/testsuite/ * gcc.target/powerpc/pr96493.c: New file.=