From patchwork Mon Jan 31 18:55:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 50599 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF1093857815 for ; Mon, 31 Jan 2022 18:56:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF1093857815 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643655415; bh=uyaegPfp63qTPPLevpVKJFTwAIl89TT+1PGLc7Wjh+w=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=PoTnGP24jtyKSjw0C/vuogYszp8VG54unQgfRBLekgifiqYdBfNABWeyNKlm9Oblw 3ixcjJmskCKG6LK6tAbR/ITzCd1FytWQ5QQGgy7MFPIIgJtF7+IQgejMAaXnpKZ4Hr rVWkujiHOJkIjUPZ7ChdGzRNN0bYmf5KeGSZC49M= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by sourceware.org (Postfix) with ESMTPS id 79E50385C019 for ; Mon, 31 Jan 2022 18:55:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 79E50385C019 Received: by mail-pg1-x52f.google.com with SMTP id z131so13037412pgz.12 for ; Mon, 31 Jan 2022 10:55:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uyaegPfp63qTPPLevpVKJFTwAIl89TT+1PGLc7Wjh+w=; b=jCHLbx9QYy0372j804eMMge/iAWwhZcxMCCcDB3ZchlPaS6bKPPVn/sDiC9bPa/dQe ljtdMoGdX/hBZMjhdQVXn004631ae/5KNpB2sLVBuZtBFHmZypjeBfVS9VJASEmF6d07 DdD7ZZCvP4YviBSQCiV85DJjIbRBsGXXv0pgKxM9LUsz8pBWXbvZJZgZrCZ3/zeOaRRR b49sZX3hg3ty3eLvK/P9j7BNWjZM5g+ElLaXPSaCjeT85kHalBSFOCie3Ygo1/i5DZMD dO8dHWjSyE0AWJ6ucrYlhn6dITUGODVME44F/6hy73k/IvRw2im2zrIQAay3+2wJ+DdQ nODA== X-Gm-Message-State: AOAM530nvPacBZL5tblYklZxgmm/wDaHJpJePLgiie+JaOXlKPsSOwoq g+AMtl3d5vBAh1g11agL6SrANRckmGY= X-Google-Smtp-Source: ABdhPJyjz3l8/jQ3mBWX5z2/do54JdEKU7z9JjB5kw5a+nmi+bVDQTv5J3VnJiI4jlEV1HIhRIkDRA== X-Received: by 2002:aa7:8490:: with SMTP id u16mr21411087pfn.1.1643655330282; Mon, 31 Jan 2022 10:55:30 -0800 (PST) Received: from gnu-tgl-2.localdomain ([172.58.35.133]) by smtp.gmail.com with ESMTPSA id d12sm22572656pgk.29.2022.01.31.10.55.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 10:55:29 -0800 (PST) Received: from gnu-tgl-2.. (localhost [IPv6:::1]) by gnu-tgl-2.localdomain (Postfix) with ESMTP id 194873004A3 for ; Mon, 31 Jan 2022 10:55:28 -0800 (PST) To: gcc-patches@gcc.gnu.org Subject: [GCC 11 PATCH 1/5] x86: Remove "%!" before ret Date: Mon, 31 Jan 2022 10:55:24 -0800 Message-Id: <20220131185528.619688-2-hjl.tools@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220131185528.619688-1-hjl.tools@gmail.com> References: <20220131185528.619688-1-hjl.tools@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3028.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: "H.J. Lu via Gcc-patches" From: "H.J. Lu" Reply-To: "H.J. Lu" Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Before MPX was removed, "%!" was mapped to case '!': if (ix86_bnd_prefixed_insn_p (current_output_insn)) fputs ("bnd ", file); return; After CET was added and MPX was removed, "%!" was mapped to case '!': if (ix86_notrack_prefixed_insn_p (current_output_insn)) fputs ("notrack ", file); return; ix86_notrack_prefixed_insn_p always returns false on ret since the notrack prefix is only for indirect branches. Remove the unused "%!" before ret. PR target/103307 * config/i386/i386.c (ix86_code_end): Remove "%!" before ret. (ix86_output_function_return): Likewise. * config/i386/i386.md (simple_return_pop_internal): Likewise. (cherry picked from commit 8e410de43ce039bbe08f1e0195e3b6ec24f68cae) --- gcc/config/i386/i386.c | 4 ++-- gcc/config/i386/i386.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 8e8c8beb366..4ba1a218ee6 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -6000,7 +6000,7 @@ ix86_code_end (void) xops[0] = gen_rtx_REG (Pmode, regno); xops[1] = gen_rtx_MEM (Pmode, stack_pointer_rtx); output_asm_insn ("mov%z0\t{%1, %0|%0, %1}", xops); - output_asm_insn ("%!ret", NULL); + fputs ("\tret\n", asm_out_file); final_end_function (); init_insn_lengths (); free_after_compilation (cfun); @@ -16027,7 +16027,7 @@ ix86_output_function_return (bool long_p) } if (!long_p) - return "%!ret"; + return "ret"; return "rep%; ret"; } diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index db9dbf384ad..1aff2ac2a82 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -13912,7 +13912,7 @@ (define_insn_and_split "simple_return_pop_internal" [(simple_return) (use (match_operand:SI 0 "const_int_operand"))] "reload_completed" - "%!ret\t%0" + "ret\t%0" "&& cfun->machine->function_return_type != indirect_branch_keep" [(const_int 0)] "ix86_split_simple_return_pop_internal (operands[0]); DONE;"