From patchwork Fri May 7 02:49:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 1475308 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=kZ3SxCiY; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fbw144lNrz9sVt for ; Fri, 7 May 2021 12:50:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C7A673AAA0D0; Fri, 7 May 2021 02:50:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7A673AAA0D0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1620355828; bh=fNXJHyR9SdOo15JH+SMMSjb+Vqu1y4GR6ThsumoHgy0=; h=To:Subject:Date:In-Reply-To:References:In-Reply-To:References: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help: List-Subscribe:From:Reply-To:Cc:From; b=kZ3SxCiYd8SLgbPzSD+WM1q1J2eWbnT12IvlwvFLPyjudm/X41QGtrKaN2XlU3YlE /DOicA1+CGKFmWGnOaodUQjimdR9yzUX29Bv6fR3jNr2qbbnui723g7Ra+txZIyWNt 1ciH6Nc6dVFosaLuXQ8Jt75Bm5/+h1lwP7F8JvGk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 371063AA9817 for ; Fri, 7 May 2021 02:50:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 371063AA9817 Received: by mail-pj1-x102d.google.com with SMTP id cl24-20020a17090af698b0290157efd14899so4584808pjb.2 for ; Thu, 06 May 2021 19:50:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=fNXJHyR9SdOo15JH+SMMSjb+Vqu1y4GR6ThsumoHgy0=; b=uXJZbb2/vcFZLMeJR/kdU4+p1yIfIxQyojng0a+ccdYHNVrG2Gv26OH0C89Ib1/NRg lu5TPNhS93WPp6/JpGTtGDQhuhLiEr2YLmCTuzhVtqkADeD9mjTx2ybTmlAV7Yx5HNSX jZwZgx/9WMDVCTMzo20WkGiJnmTqaSnIg3bjTRUM95WOADpWh1/2iatpfVOCBYz6yRe7 djbqhGioa7hlUtM4zJsLZ5fj2K7RTShI9fkxZ+NA7loN/0Vm4x7J5bwqcvke0ra6VqwE AyWA3SHkhTHwXI4wj/s3FPcx3PN2RLIE70eoZFN5NxJhZwQaMagDO0c/4s/6u8zQP6w+ AV2Q== X-Gm-Message-State: AOAM531HQZAgUVNRBL4v0m+LTRC4e/WSTqBCj0JluLe2HET6HBEXfmp1 2+UC1fAWfikPvRFISAO4saxjgovgwZD0HEf3 X-Google-Smtp-Source: ABdhPJxduH8TSPpGCj3UmEIDqlkQL3SRde6LIpTAgT1FYEWB/RQvrf+gBfRZRQpXx+ziDf3E2IywyQ== X-Received: by 2002:a17:902:8a8c:b029:ed:223b:2881 with SMTP id p12-20020a1709028a8cb02900ed223b2881mr7934240plo.8.1620355824939; Thu, 06 May 2021 19:50:24 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:a19e:d7f4:3b6a:77ba]) by smtp.gmail.com with ESMTPSA id y14sm3278449pfm.123.2021.05.06.19.50.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 19:50:24 -0700 (PDT) To: gcc-patches@gcc.gnu.org Subject: Revert "rs6000: Avoid -fpatchable-function-entry* regressions on powerpc64 be [PR98125]" Date: Fri, 7 May 2021 12:19:51 +0930 Message-Id: <7409663f10a5873f9e30bc6dddd03d9872258368.1620345816.git.amodra@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: X-Spam-Status: No, score=-3038.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alan Modra via Gcc-patches From: Alan Modra Reply-To: Alan Modra Cc: Jakub Jelinek , Segher Boessenkool Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This reverts commit b680b9049737198d010e49cf434704c6a6ed2b3f now that the PowerPC64 ELFv1 regression is fixed properly. PR testsuite/98125 * targhooks.h (default_print_patchable_function_entry_1): Delete. * targhooks.c (default_print_patchable_function_entry_1): Delete. (default_print_patchable_function_entry): Expand above. * config/rs6000/rs6000.c (TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Don't define. (rs6000_print_patchable_function_entry): Delete. * testsuite/g++.dg/pr93195a.C: Revert 2021-04-03 change. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 663eed4f055..d43c36e7f1a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1362,10 +1362,6 @@ static const struct attribute_spec rs6000_attribute_table[] = #define TARGET_ASM_ASSEMBLE_VISIBILITY rs6000_assemble_visibility #endif -#undef TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY -#define TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY \ - rs6000_print_patchable_function_entry - #undef TARGET_SET_UP_BY_PROLOGUE #define TARGET_SET_UP_BY_PROLOGUE rs6000_set_up_by_prologue @@ -14957,30 +14953,6 @@ rs6000_assemble_visibility (tree decl, int vis) } #endif -/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function - entry. If RECORD_P is true and the target supports named sections, - the location of the NOPs will be recorded in a special object section - called "__patchable_function_entries". This routine may be called - twice per function to put NOPs before and after the function - entry. */ - -void -rs6000_print_patchable_function_entry (FILE *file, - unsigned HOST_WIDE_INT patch_area_size, - bool record_p) -{ - unsigned int flags = SECTION_WRITE | SECTION_RELRO; - /* When .opd section is emitted, the function symbol - default_print_patchable_function_entry_1 is emitted into the .opd section - while the patchable area is emitted into the function section. - Don't use SECTION_LINK_ORDER in that case. */ - if (!(TARGET_64BIT && DEFAULT_ABI != ABI_ELFv2) - && HAVE_GAS_SECTION_LINK_ORDER) - flags |= SECTION_LINK_ORDER; - default_print_patchable_function_entry_1 (file, patch_area_size, record_p, - flags); -} - enum rtx_code rs6000_reverse_condition (machine_mode mode, enum rtx_code code) { diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 952fad422eb..d69c9a2d819 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -1832,15 +1832,17 @@ default_compare_by_pieces_branch_ratio (machine_mode) return 1; } -/* Helper for default_print_patchable_function_entry and other - print_patchable_function_entry hook implementations. */ +/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function + entry. If RECORD_P is true and the target supports named sections, + the location of the NOPs will be recorded in a special object section + called "__patchable_function_entries". This routine may be called + twice per function to put NOPs before and after the function + entry. */ void -default_print_patchable_function_entry_1 (FILE *file, - unsigned HOST_WIDE_INT - patch_area_size, - bool record_p, - unsigned int flags) +default_print_patchable_function_entry (FILE *file, + unsigned HOST_WIDE_INT patch_area_size, + bool record_p) { const char *nop_templ = 0; int code_num; @@ -1862,6 +1864,9 @@ default_print_patchable_function_entry_1 (FILE *file, patch_area_number++; ASM_GENERATE_INTERNAL_LABEL (buf, "LPFE", patch_area_number); + unsigned int flags = SECTION_WRITE | SECTION_RELRO; + if (HAVE_GAS_SECTION_LINK_ORDER) + flags |= SECTION_LINK_ORDER; switch_to_section (get_section ("__patchable_function_entries", flags, current_function_decl)); assemble_align (POINTER_SIZE); @@ -1878,25 +1883,6 @@ default_print_patchable_function_entry_1 (FILE *file, output_asm_insn (nop_templ, NULL); } -/* Write PATCH_AREA_SIZE NOPs into the asm outfile FILE around a function - entry. If RECORD_P is true and the target supports named sections, - the location of the NOPs will be recorded in a special object section - called "__patchable_function_entries". This routine may be called - twice per function to put NOPs before and after the function - entry. */ - -void -default_print_patchable_function_entry (FILE *file, - unsigned HOST_WIDE_INT patch_area_size, - bool record_p) -{ - unsigned int flags = SECTION_WRITE | SECTION_RELRO; - if (HAVE_GAS_SECTION_LINK_ORDER) - flags |= SECTION_LINK_ORDER; - default_print_patchable_function_entry_1 (file, patch_area_size, record_p, - flags); -} - bool default_profile_before_prologue (void) { diff --git a/gcc/targhooks.h b/gcc/targhooks.h index 9928d064abd..39a6f82f143 100644 --- a/gcc/targhooks.h +++ b/gcc/targhooks.h @@ -230,9 +230,6 @@ extern bool default_use_by_pieces_infrastructure_p (unsigned HOST_WIDE_INT, bool); extern int default_compare_by_pieces_branch_ratio (machine_mode); -extern void default_print_patchable_function_entry_1 (FILE *, - unsigned HOST_WIDE_INT, - bool, unsigned int); extern void default_print_patchable_function_entry (FILE *, unsigned HOST_WIDE_INT, bool); diff --git a/gcc/testsuite/g++.dg/pr93195a.C b/gcc/testsuite/g++.dg/pr93195a.C index b14f1b3e341..26d265da74e 100644 --- a/gcc/testsuite/g++.dg/pr93195a.C +++ b/gcc/testsuite/g++.dg/pr93195a.C @@ -1,5 +1,4 @@ /* { dg-do link { target { ! { nvptx*-*-* visium-*-* } } } } */ -/* { dg-skip-if "not supported" { { powerpc*-*-* } && lp64 } } */ // { dg-require-effective-target o_flag_in_section } /* { dg-options "-O0 -fpatchable-function-entry=1" } */ /* { dg-additional-options "-fno-pie" { target sparc*-*-* } } */