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/105649] Wrong .localentry address on powerpc64le with -fpatchable-function-entry=1 Date: Fri, 30 Sep 2022 12:18:32 +0000 [thread overview] Message-ID: <bug-105649-4-eZSYV4yaI6@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-105649-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105649 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kewen Lin <linkw@gcc.gnu.org>: https://gcc.gnu.org/g:c23b5006d3ffeda1a9edf5fd817765a6da3696ca commit r13-2984-gc23b5006d3ffeda1a9edf5fd817765a6da3696ca Author: Kewen Lin <linkw@linux.ibm.com> Date: Fri Sep 30 07:16:49 2022 -0500 rs6000: Rework ELFv2 support for -fpatchable-function-entry* [PR99888] As PR99888 and its related show, the current support for -fpatchable-function-entry on powerpc ELFv2 doesn't work well with global entry existence. For example, with one command line option -fpatchable-function-entry=3,2, it got below w/o this patch: .LPFE1: nop nop .type foo, @function foo: nop .LFB0: .cfi_startproc .LCF0: 0: addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l .localentry foo,.-foo , the assembly is unexpected since the patched nops have no effects when being entered from local entry. This patch is to update the nops patched before and after local entry, it looks like: .type foo, @function foo: .LFB0: .cfi_startproc .LCF0: 0: addis 2,12,.TOC.-.LCF0@ha addi 2,2,.TOC.-.LCF0@l nop nop .localentry foo,.-foo nop PR target/99888 PR target/105649 gcc/ChangeLog: * doc/invoke.texi (option -fpatchable-function-entry): Adjust the documentation for PowerPC ELFv2 ABI dual entry points. * config/rs6000/rs6000-internal.h (rs6000_print_patchable_function_entry): New function declaration. * config/rs6000/rs6000-logue.cc (rs6000_output_function_prologue): Support patchable-function-entry by emitting nops before and after local entry for the function that needs global entry. * config/rs6000/rs6000.cc (rs6000_print_patchable_function_entry): Skip the function that needs global entry till global entry has been emitted. * config/rs6000/rs6000.h (struct machine_function): New bool member global_entry_emitted. gcc/testsuite/ChangeLog: * gcc.target/powerpc/pr99888-1.c: New test. * gcc.target/powerpc/pr99888-2.c: New test. * gcc.target/powerpc/pr99888-3.c: New test. * gcc.target/powerpc/pr99888-4.c: New test. * gcc.target/powerpc/pr99888-5.c: New test. * gcc.target/powerpc/pr99888-6.c: New test. * c-c++-common/patchable_function_entry-default.c: Adjust for powerpc_elfv2 to avoid compilation error.
next prev parent reply other threads:[~2022-09-30 12:18 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-05-18 19:56 [Bug target/105649] New: " giuliano.belinassi at gmail dot com 2022-05-19 6:13 ` [Bug target/105649] " rguenth at gcc dot gnu.org 2022-05-19 13:23 ` giuliano.belinassi at gmail dot com 2022-09-30 12:18 ` cvs-commit at gcc dot gnu.org [this message] 2022-09-30 12:34 ` linkw at gcc dot gnu.org
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-105649-4-eZSYV4yaI6@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: linkBe 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).