From patchwork Fri Aug 9 07:14:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joern Wolfgang Rennecke X-Patchwork-Id: 1970826 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="key not found in DNS" header.d=riscy-ip.com header.i=@riscy-ip.com header.a=rsa-sha256 header.s=default header.b=cKflTcBh; 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 4WgFXb0NVlz1ybS for ; Fri, 9 Aug 2024 17:14:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 94B463858C33 for ; Fri, 9 Aug 2024 07:14:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from omta036.useast.a.cloudfilter.net (omta036.useast.a.cloudfilter.net [44.202.169.35]) by sourceware.org (Postfix) with ESMTPS id B35EF3858D20 for ; Fri, 9 Aug 2024 07:14:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B35EF3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=riscy-ip.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=riscy-ip.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B35EF3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723187656; cv=none; b=Nk0Gp6h1X41oVFbybKnRT20alOFIJI4K8ZxpsQkK1p1zbg7wmehsWrOJq4C/l9us5rqJRh8W2cR/Q6i1yjOUE86c66Bn/Xo93rEPwS+tTacm/o8ggFbsrd3YMR1QLxe0UnOZ03MTd0Gt3k6Gldt5cI1CA1VYpLg0cE9q0olgtAU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1723187656; c=relaxed/simple; bh=km3sx4j43KL8ucnoHiYofSP3SrumBIYK0CwlU5mi5XU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:To:From:Subject; b=Avy1ZQc4wQURWCrTSaw9uXAcl34SmJEi2KeBuu9uvwFk7WmCuRGFFh+qGWC8Lo4yHsTkIAdpPYMvWyxW6lDG26Aq/+rGohp/62swLp4/Gc6J59v9d8MvjFkVEPYbYoOVMbrLyC5zWLLAYk81hAmODKUf5R1MhpR96FFwz5ORQq8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6002a.ext.cloudfilter.net ([10.0.30.222]) by cmsmtp with ESMTPS id c7Qlsesc9iA19cJpFsMjM8; Fri, 09 Aug 2024 07:14:13 +0000 Received: from just2023.justhost.com ([173.254.28.231]) by cmsmtp with ESMTPS id cJpDsH9IsX56wcJpDs458y; Fri, 09 Aug 2024 07:14:12 +0000 X-Authority-Analysis: v=2.4 cv=MY6nuI/f c=1 sm=1 tr=0 ts=66b5c1c4 a=YASUF7UNcoqeS7t9RS8wjw==:117 a=YASUF7UNcoqeS7t9RS8wjw==:17 a=yoJbH4e0A30A:10 a=r77TgQKjGQsHNAKrUKIA:9 a=RAA5OCdRJX7JOiWdZpYA:9 a=QEXdDO2ut3YA:10 a=5bgceILEAAAA:8 a=wTFwDHi6Fet15R3b7RYA:9 a=m-Z_27IZkzAA:10 a=zZCYzV9kfG8A:10 a=bA5y-8BQ6xV_CXoMkqSI:22 a=7z3vdgOOfqBDWbZOyawU:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=riscy-ip.com; s=default; h=Subject:From:To:MIME-Version:Date:Message-ID: Content-Type:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=km3sx4j43KL8ucnoHiYofSP3SrumBIYK0CwlU5mi5XU=; b=cKflTcBh3nOb/uzYjq7L/9TJ/G RMYdg81qBvTs3rvssxpvt0cyMg1vWrkLc4oVmXTJ7lhsZVKTct9Jw6kCcAlDYP2X7tKb+vDIL5rtZ 7uoFyL5EvyE70a7k3WWOtL3fBzjqZpoYrJZFq0sjzzLek36Wxivyo0NMyz52NrarLymSj1+IEx02o jpUyjCG9h/+16mZWYNkA5IGyUmeEdWu4P6+d0jUcrx93jPuIjPiB3cWip/Gs1ZWyeqtQP8rLSrdiN V5vTO4MpoLkHe7ov7S7irbv3+Da0qDg8RQVR92fdxFBUjbsUuABVF3Rkcs5BQtxW6Guy1SCQEijVk 3LkfoVgA==; Received: from cust213-dsl91-135-11.idnet.net ([91.135.11.213]:40452 helo=[192.168.1.137]) by just2023.justhost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1scJpD-002IHP-0h for gcc-patches@gcc.gnu.org; Fri, 09 Aug 2024 01:14:11 -0600 Message-ID: <920bc655-813d-4dd6-8b0e-ceb6972ca68b@riscy-ip.com> Date: Fri, 9 Aug 2024 08:14:08 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-MW To: GCC Patches From: Joern Wolfgang Rennecke Subject: [PATCH] Avoid cfg corruption when using sjlj exceptions where loops are present in the assign_params emitted code. X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - just2023.justhost.com X-AntiAbuse: Original Domain - gcc.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - riscy-ip.com X-BWhitelist: no X-Source-IP: 91.135.11.213 X-Source-L: No X-Exim-ID: 1scJpD-002IHP-0h X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cust213-dsl91-135-11.idnet.net ([192.168.1.137]) [91.135.11.213]:40452 X-Source-Auth: joern.rennecke@riscy-ip.com X-Email-Count: 1 X-Org: HG=bhshared_jh;ORG=bluehost; X-Source-Cap: cmlzY3lpcGM7cmlzY3lpcGM7anVzdDIwMjMuanVzdGhvc3QuY29t X-Local-Domain: yes X-CMAE-Envelope: MS4xfGvzYfx1w5n3chQIHxzMowCgFvyyVT+GnX5FATezvlMBTMFVPQk7wzJaELhLAisKkbeuM5n3Rz0T6zMlyTbIskHseO6wNWjCeAzsjHlZ7a9+GgQxOQoO v3sc0dCswgD4WkrDpJ95nIMVeQTnTqi7b7MNba9srSwKSL71/FGcZHu+qyFdoZAd1yGeCPlqpwXYbItnuAI1QoX53NCGSsNeg0aozrddvWtGv4OB4fKuyc7X X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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 bootstrapped on x86_64-pc-linux-gnu. Avoid cfg corruption when using sjlj exceptions where loops are present in the assign_params emitted code. 2024-08-06 Joern Rennecke gcc/ * except.cc (sjlj_emit_function_enter): Set fn_begin_outside_block again if encountering a jump instruction. diff --git a/gcc/except.cc b/gcc/except.cc index b5886e97be9..5bb5edbd806 100644 --- a/gcc/except.cc +++ b/gcc/except.cc @@ -1228,6 +1228,10 @@ sjlj_emit_function_enter (rtx_code_label *dispatch_label) else if (NOTE_INSN_BASIC_BLOCK_P (fn_begin)) fn_begin_outside_block = false; } + /* assign_params can indirectly call emit_block_move_via_loop, e.g. + for g++.dg/torture/pr85627.C for 16-bit targets. */ + else if (JUMP_P (fn_begin)) + fn_begin_outside_block = true; #ifdef DONT_USE_BUILTIN_SETJMP if (dispatch_label)