From patchwork Mon Mar 18 10:52:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Hongtao" X-Patchwork-Id: 1913072 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=n/Blomwb; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TysBN6LMkz1yWy for ; Mon, 18 Mar 2024 21:52:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 96DBB385840F for ; Mon, 18 Mar 2024 10:52:25 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by sourceware.org (Postfix) with ESMTPS id 3C53E3858D1E for ; Mon, 18 Mar 2024 10:52:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3C53E3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3C53E3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710759127; cv=none; b=gpQuxjrYSuXzvZhCkbiCpxaPkoa8dHPhbWwTI1VEvgJe/tfEnrVa7S88oFSWpjCY6wRrZ4KYqFHCRXaQeXAgQ7HEZqOD7PhV3SVfS2Gfbb1CNZSz2d8EUKMxSfO8oFSPfEQ0c6ezYsaoPa3EFoP0aptcQ6ga7hYBwFNdg0JV4rA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710759127; c=relaxed/simple; bh=WlLqRsL0ZnJ3LRus0B7CMBj7s2LeIwfz1hniyJBh/Z8=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=XlZ2oS6qQj0Qhrfscr0YZ9Q1pgLfWYgaWoaVCHDY4i7MB6HwvcTZtyCC1KFcqbepuPt9Gnsp6mP1N9g6hM4Vo8k5Si576hY237nWpxD/fvOJi2voXikgIkFCSWdgIOKGgpDcXt4d8N/6I/8wGF3AMMkOze7tFX0hRhhxTXsnYKE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1710759125; x=1742295125; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WlLqRsL0ZnJ3LRus0B7CMBj7s2LeIwfz1hniyJBh/Z8=; b=n/Blomwbq8dL/sfAGsmeBQJLxWpEB44MFGvM1Rsi6GVdAQMcg6NdLuUK Khxn7lhCABsh2LHwf7E1Bc+I0tj8a6RAeXStgj1BKF0RAW6IEtFHjOK7T 1AGaubxHmekxo5akULT4vwBDDv2jsx5RTtKJaQPzy24Muq2zAtfZ4kumF iLgkxiMTxhwdxnxKWGNrJ65fDWDUr7ksKDz9x70aD0tJWQdkMGHtBJlQ9 60TdfTVfH+I5MMwZKDX/mP0P8Y9hQHncWWUrmWFIcRRe++0jlkSvq3Rqs xu4m9DTeE67kwzAySnv3qn22BWModaWT6BJ/pvb8wt8ghNnCrs3KJ63l1 A==; X-IronPort-AV: E=McAfee;i="6600,9927,11016"; a="5397604" X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="5397604" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2024 03:52:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,134,1708416000"; d="scan'208";a="13816352" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by orviesa006.jf.intel.com with ESMTP; 18 Mar 2024 03:52:02 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id EC876100568D; Mon, 18 Mar 2024 18:52:00 +0800 (CST) From: liuhongt To: gcc-patches@gcc.gnu.org Cc: ubizjak@gmail.com Subject: [PATCH] i386 [stv]: Handle REG_EH_REGION note [pr111822]. Date: Mon, 18 Mar 2024 18:52:00 +0800 Message-Id: <20240318105200.3555938-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Commit r14-9459-g618e34d56cc38e only handles general_scalar_chain::convert_op. The patch also handles timode_scalar_chain::convert_op to avoid potential similar bug. Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}. Ok for trunk and backport to releases/gcc-13 branch? gcc/ChangeLog: PR target/111822 * config/i386/i386-features.cc (timode_scalar_chain::convert_op): Handle REG_EH_REGION note. --- gcc/config/i386/i386-features.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/gcc/config/i386/i386-features.cc b/gcc/config/i386/i386-features.cc index c7d7a965901..38f57d96df5 100644 --- a/gcc/config/i386/i386-features.cc +++ b/gcc/config/i386/i386-features.cc @@ -1794,12 +1794,26 @@ timode_scalar_chain::convert_op (rtx *op, rtx_insn *insn) *op = gen_rtx_SUBREG (V1TImode, *op, 0); else if (MEM_P (*op)) { + rtx_insn* eh_insn; rtx tmp = gen_reg_rtx (V1TImode); - emit_insn_before (gen_rtx_SET (tmp, - gen_gpr_to_xmm_move_src (V1TImode, *op)), - insn); + eh_insn + = emit_insn_before (gen_rtx_SET (tmp, + gen_gpr_to_xmm_move_src (V1TImode, + *op)), + insn); *op = tmp; + if (cfun->can_throw_non_call_exceptions) + { + /* Handle REG_EH_REGION note. */ + rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX); + if (note) + { + control_flow_insns.safe_push (eh_insn); + add_reg_note (eh_insn, REG_EH_REGION, XEXP (note, 0)); + } + } + if (dump_file) fprintf (dump_file, " Preloading operand for insn %d into r%d\n", INSN_UID (insn), REGNO (tmp));