From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1668449312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Ui4WFB2c+8I9o3OHiaRFWghsN5uZkErbgTFoqU/XKiE=; b=arETnSZOOIK9pO5/Nx980O30mfoPyvW9sCiBdbAgOu6rppcobr5xhQRonKki1NHiUv5lxR KLQBIi3KJXdouo6BYal3yaNmEmcpavm+zauu6T7Fq83pDSQ29yDnvqz2B9mayLAzGOjujY jTWhxdjzRYTDaPoiwVP9P4NZxeNjlW4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1668449312; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Ui4WFB2c+8I9o3OHiaRFWghsN5uZkErbgTFoqU/XKiE=; b=5tOBYlakKqq6N+HK3tgTrmFN8TSXfr+SGVAeSAcEQodiqPUPEgA1sgqRRME+vhQAb/yaty seTnyetYPAx9sbDA== 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) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/107485 - fix non-call exception ICE with inlining MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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 List-Id: 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); } } -- 2.35.3