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 A894E3857711 for ; Fri, 23 Jun 2023 08:27:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A894E3857711 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 E1F761F45F for ; Fri, 23 Jun 2023 08:27:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1687508841; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=l+5wqZDic5y4gDZ+4mliu2qQjhMWi/E616BYO6Uswb8=; b=0+mKmbcmkt5Og7MN2lYGfoCFn5+p3mkQzyTJQirRcJizjSJHoBzCXysCoOYd5Cjr4MMG7I qYFoooH3/e5PVdoHz6alR55Pw02uDxxBmo3Puve+24DwnatDUJUyF0BEDzVdmAKFTh3S3a 1tPEHwebhpqplQH/J/sySH2HTcvbn5w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1687508841; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=l+5wqZDic5y4gDZ+4mliu2qQjhMWi/E616BYO6Uswb8=; b=ZaSYpocRZ4hwqmlDVGxX5ZnIb3ZOhbBVcFIbXo/b3TZL5vWpH3acg2QSVSEcTU2jJCZQFp LeG5MmIXOZ1OzBCw== 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 CF9571331F for ; Fri, 23 Jun 2023 08:27:21 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id W7VgMWlXlWQqTQAAMHmgww (envelope-from ) for ; Fri, 23 Jun 2023 08:27:21 +0000 Date: Fri, 23 Jun 2023 10:27:21 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH 3/6] Properly guard vect_look_through_possible_promotion MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20230623082721.CF9571331F@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.1 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,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 List-Id: The function ends up getting called on VECTOR_TYPEs which it really isn't prepared for and with the TYPE_PRECISION checking changes will ICE. The following exits early when the type to work on isn't scalar integral. Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu, will push after that finished. * tree-vect-patterns.cc (vect_look_through_possible_promotion): Exit early when the type isn't scalar integral. --- gcc/tree-vect-patterns.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-patterns.cc b/gcc/tree-vect-patterns.cc index 60bc9be6819..a04accf3b03 100644 --- a/gcc/tree-vect-patterns.cc +++ b/gcc/tree-vect-patterns.cc @@ -398,8 +398,11 @@ vect_look_through_possible_promotion (vec_info *vinfo, tree op, vect_unpromoted_value *unprom, bool *single_use_p = NULL) { - tree res = NULL_TREE; tree op_type = TREE_TYPE (op); + if (!INTEGRAL_TYPE_P (op_type)) + return NULL_TREE; + + tree res = NULL_TREE; unsigned int orig_precision = TYPE_PRECISION (op_type); unsigned int min_precision = orig_precision; stmt_vec_info caster = NULL; @@ -3881,6 +3884,7 @@ vect_recog_vector_vector_shift_pattern (vec_info *vinfo, if (TREE_CODE (oprnd0) != SSA_NAME || TREE_CODE (oprnd1) != SSA_NAME || TYPE_MODE (TREE_TYPE (oprnd0)) == TYPE_MODE (TREE_TYPE (oprnd1)) + || !INTEGRAL_TYPE_P (TREE_TYPE (oprnd0)) || !type_has_mode_precision_p (TREE_TYPE (oprnd1)) || TYPE_PRECISION (TREE_TYPE (lhs)) != TYPE_PRECISION (TREE_TYPE (oprnd0))) -- 2.35.3