From patchwork Mon Nov 14 18:08:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 19961 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2286931wru; Mon, 14 Nov 2022 10:09:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf7kFiDo6enpS/xLNwRLTc9xXFPmZwCx9+MBnAiOw9tcwusoNqlat3MtuXxL+AonMEvrN4Fj X-Received: by 2002:a05:6402:1241:b0:461:e3e1:bc3b with SMTP id l1-20020a056402124100b00461e3e1bc3bmr12209252edw.145.1668449368018; Mon, 14 Nov 2022 10:09:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668449368; cv=none; d=google.com; s=arc-20160816; b=NXW5HZylag45bvGEF4FaFfwjEo3xZ2wf0cy7oRCCohC3wFtuBR45yxoDb55ZtxAbOL dRJe3+0bIS5RCPgF5Es12PS3jlHguIIPU1U7Iqh/nr4s8S2UYC9pUukxDS4LZtGIExl3 noiPhcjtsk+QTbOK48IqXmDt8ZD0yPJ6De2t8nd3QdPFvptvHolrXKUD01AjNZLGAaCB LxZUfzOdhpau2A4gcOiJEKpRwVfQ9jSph2Gakf4WET0uEkhI95rf5qlwBIUJxvf3i1gV LlpV5aGhHF8RM4bfdkWDwfXeIGIkVh1VJYoCDuxceV+zXtb5LMpNzozB1aiy7qMWZ21B geig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:message-id :mime-version:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=Ui4WFB2c+8I9o3OHiaRFWghsN5uZkErbgTFoqU/XKiE=; b=Y4xWy/udqAstrfGp480sDYnZWzO7yTPq3Jh1Cg3ku/jTuXLnjmBB2sIZezHAlp4Pkd LnmiDJglR4h+LkMVFsPu8OWf+gK0jNlsOkXX3QDqiXXRGZldhedEGOR52RpZMoiP5U34 CumER+gZ3AjXm070gEydYniDAqzdVeynuJdJtTd5KiytJna7Y47AT+lQBdmoc3gitfrJ nwN01Ob95S6cBwZHQz3R4M7y0OByxmGcu1vCRhJIhecE4vXnwR0GicEMxVcVsucK5ZwW GLn35FRZIZmqXYnLIZI4tultj8lvJUZf5l/ePmDdCeAUR6hQRKiHEww8O0TQd07x1/ee /Mxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u+uU0TPI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id o13-20020a170906974d00b007708400bee5si9940016ejy.1003.2022.11.14.10.09.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Nov 2022 10:09:28 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=u+uU0TPI; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AA61D3830B33 for ; Mon, 14 Nov 2022 18:09:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AA61D3830B33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668449357; bh=Ui4WFB2c+8I9o3OHiaRFWghsN5uZkErbgTFoqU/XKiE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u+uU0TPIPyZjDnRSbSJHZsn8uICLw4ofpIR5dJWcln+6yZqPcx5JCfd9zwW/xQhY0 U3IocUJEHf46xbzvgK1409i6tDSnfPWXAVFcEnxZBdCaCP+DDrfuMrxrKT7FsfHdOv zvRHt64O2gMJk9KGRaLMbetKmmaQkRTMe0vvSb0Q= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 796F0385188F for ; Mon, 14 Nov 2022 18:08:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 796F0385188F Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5F0D72020B for ; Mon, 14 Nov 2022 18:08:32 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 49DD013A8C for ; Mon, 14 Nov 2022 18:08:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id UQjRECCEcmPRbgAAMHmgww (envelope-from ) for ; Mon, 14 Nov 2022 18:08:32 +0000 Date: Mon, 14 Nov 2022 19:08:31 +0100 (CET) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/107485 - fix non-call exception ICE with inlining MIME-Version: 1.0 Message-Id: <20221114180832.49DD013A8C@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749495964087291628?= X-GMAIL-MSGID: =?utf-8?q?1749495964087291628?= Inlining performs a wrong non-call exception fixup for VEC_COND_EXPRs which on the branch fail to properly have the condition split out in the first place. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed to the GCC 10 branch which is the only one this code snippet prevails. PR tree-optimization/107485 * tree-inline.c (remap_gimple_stmt): Use correct type for split out condition of [VEC_]COND_EXPRs. --- gcc/tree-inline.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index c20c25ceb50..658b09c07d2 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -1979,11 +1979,10 @@ remap_gimple_stmt (gimple *stmt, copy_body_data *id) || gimple_assign_rhs_code (ass) == VEC_COND_EXPR) && gimple_could_trap_p (ass)) { - gassign *cmp - = gimple_build_assign (make_ssa_name (boolean_type_node), - gimple_assign_rhs1 (ass)); + tree def = make_ssa_name (TREE_TYPE (gimple_assign_rhs1 (ass))); + gassign *cmp = gimple_build_assign (def, gimple_assign_rhs1 (ass)); gimple_seq_add_stmt (&stmts, cmp); - gimple_assign_set_rhs1 (ass, gimple_assign_lhs (cmp)); + gimple_assign_set_rhs1 (ass, def); } }