From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 48D7B3858C51; Wed, 3 Aug 2022 02:53:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48D7B3858C51 From: "linkw at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99888] Add powerpc ELFv2 support for -fpatchable-function-entry* Date: Wed, 03 Aug 2022 02:53:33 +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: linkw at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: linkw at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cc cf_reconfirmed_on assigned_to 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: Wed, 03 Aug 2022 02:53:33 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99888 Kewen Lin changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |ASSIGNED Ever confirmed|0 |1 CC| |linkw at gcc dot gnu.org Last reconfirmed| |2022-08-03 Assignee|unassigned at gcc dot gnu.org |linkw at gcc dot gn= u.org --- Comment #1 from Kewen Lin --- cat test.c=20 extern int a; int foo (int b){ return a + b; } on ppc64le, with option "-mcpu=3Dpower9 -fpatchable-function-entry=3D5,3", = the generated assembly looks like: .LPFE1: nop nop nop .type foo, @function foo: nop nop .LFB0: .cfi_startproc .LCF0: 0: addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l .localentry foo,.-foo std 31,-8(1) Jakub's #c0 noted that the "after" nops should be placed after local entry,= but there seem two choices to put the "before" nops, such as: 1) 0: addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l nop nop nop .localentry foo,.-foo nop nop std 31,-8(1) 2) 0: nop nop nop addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l .localentry foo,.-foo nop nop std 31,-8(1) For either of them, the "before" nops only take effects when it's entered f= rom global entry, both are counted as five insns in global entry area, there is= no differences from these two perspectives. I'd like to go with 1) if no objections.=