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/93492] Broken code with -fpatchable-function-entry and -fcf-protection=full Date: Fri, 12 Jun 2020 03:45:49 +0000 [thread overview] Message-ID: <bug-93492-4-dTN76k5RTw@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-93492-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93492 --- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by H.J. Lu <hjl@gcc.gnu.org>: https://gcc.gnu.org/g:3dcea658c9e2ac84f0726e679fd7d3b14f9106f0 commit r11-1245-g3dcea658c9e2ac84f0726e679fd7d3b14f9106f0 Author: H.J. Lu <hjl.tools@gmail.com> Date: Mon Feb 3 10:22:57 2020 -0800 x86: Add UNSPECV_PATCHABLE_AREA Currently patchable area is at the wrong place. It is placed immediately after function label, before both .cfi_startproc and ENDBR. This patch adds UNSPECV_PATCHABLE_AREA for pseudo patchable area instruction and changes ENDBR insertion pass to also insert patchable area instruction. TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY is defined to avoid placing patchable area before .cfi_startproc and ENDBR. gcc/ PR target/93492 * config/i386/i386-features.c (rest_of_insert_endbranch): Renamed to ... (rest_of_insert_endbr_and_patchable_area): Change return type to void. Add need_endbr and patchable_area_size arguments. Don't call timevar_push nor timevar_pop. Replace endbr_queued_at_entrance with insn_queued_at_entrance. Insert UNSPECV_PATCHABLE_AREA for patchable area. (pass_data_insert_endbranch): Renamed to ... (pass_data_insert_endbr_and_patchable_area): This. Change pass name to endbr_and_patchable_area. (pass_insert_endbranch): Renamed to ... (pass_insert_endbr_and_patchable_area): This. Add need_endbr and patchable_area_size;. (pass_insert_endbr_and_patchable_area::gate): Set and check need_endbr and patchable_area_size. (pass_insert_endbr_and_patchable_area::execute): Call timevar_push and timevar_pop. Pass need_endbr and patchable_area_size to rest_of_insert_endbr_and_patchable_area. (make_pass_insert_endbranch): Renamed to ... (make_pass_insert_endbr_and_patchable_area): This. * config/i386/i386-passes.def: Replace pass_insert_endbranch with pass_insert_endbr_and_patchable_area. * config/i386/i386-protos.h (ix86_output_patchable_area): New. (make_pass_insert_endbranch): Renamed to ... (make_pass_insert_endbr_and_patchable_area): This. * config/i386/i386.c (ix86_asm_output_function_label): Set function_label_emitted to true. (ix86_print_patchable_function_entry): New function. (ix86_output_patchable_area): Likewise. (x86_function_profiler): Replace endbr_queued_at_entrance with insn_queued_at_entrance. Generate ENDBR only for TYPE_ENDBR. Call ix86_output_patchable_area to generate patchable area if needed. (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): New. * config/i386/i386.h (queued_insn_type): New. (machine_function): Add function_label_emitted. Replace endbr_queued_at_entrance with insn_queued_at_entrance. * config/i386/i386.md (UNSPECV_PATCHABLE_AREA): New. (patchable_area): New. gcc/testsuite/ PR target/93492 * gcc.target/i386/pr93492-1.c: New test. * gcc.target/i386/pr93492-2.c: Likewise. * gcc.target/i386/pr93492-3.c: Likewise. * gcc.target/i386/pr93492-4.c: Likewise. * gcc.target/i386/pr93492-5.c: Likewise.
next prev parent reply other threads:[~2020-06-12 3:45 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-93492-4@http.gcc.gnu.org/bugzilla/> 2020-05-02 4:07 ` cvs-commit at gcc dot gnu.org 2020-05-07 11:56 ` jakub at gcc dot gnu.org 2020-06-12 3:45 ` cvs-commit at gcc dot gnu.org [this message] 2020-06-12 3:49 ` hjl.tools at gmail dot com 2020-06-14 15:38 ` ro at gcc dot gnu.org 2020-06-14 15:47 ` hjl.tools at gmail dot com 2020-06-14 16:52 ` iains at gcc dot gnu.org 2020-06-15 13:12 ` hjl.tools at gmail dot com 2020-06-26 23:13 ` hjl.tools at gmail dot com 2020-07-10 12:57 ` ro at CeBiTec dot Uni-Bielefeld.DE 2020-07-10 13:56 ` hjl.tools at gmail dot com 2020-07-10 14:03 ` ro at CeBiTec dot Uni-Bielefeld.DE 2020-07-10 14:04 ` hjl.tools at gmail dot com 2020-07-10 14:06 ` ro at CeBiTec dot Uni-Bielefeld.DE 2020-07-10 14:12 ` hjl.tools at gmail dot com 2020-07-10 14:16 ` ro at CeBiTec dot Uni-Bielefeld.DE 2020-07-10 14:33 ` hjl.tools at gmail dot com 2020-07-10 14:41 ` ro at CeBiTec dot Uni-Bielefeld.DE 2020-07-10 15:53 ` mikestump at comcast dot net 2020-07-10 21:54 ` hjl.tools at gmail dot com 2020-07-12 12:06 ` cvs-commit at gcc dot gnu.org 2020-07-12 12:07 ` hjl.tools at gmail dot com
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-93492-4-dTN76k5RTw@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).