From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id B5A2F394743E for ; Tue, 22 Jun 2021 09:00:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B5A2F394743E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id CFD5E1FD5F for ; Tue, 22 Jun 2021 09:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1624352451; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=cm9anW+vh+S1q6IpTIYVcqsbMHAX7x/AAPzftSEL0t4=; b=wwPDZoBhYWfhg9wC2/pDRfnjewVew+yYWCr5zY4/4t7cV7RjogaJkKZcdtI0uHlYzu0vS5 Ny7wKn84uctKeOpTn/qV9jjxSmZYknBwrHgnXkeVsK65KaOdmgjcVONGi9e2V55pNZ9KPj eU07UI6zfKHTVCHwn6mt+KviMLm8v0k= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1624352451; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=cm9anW+vh+S1q6IpTIYVcqsbMHAX7x/AAPzftSEL0t4=; b=ihBsZunkEiU375PCwuDTGg17d7ceLE6jkE5GpA31EQCDQ7krkVfP7uBMi72tg7z0O8wwPr vWWvvt0Wc+02whAg== Received: from [10.163.28.26] (unknown [10.163.28.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id BF06BA3B9C for ; Tue, 22 Jun 2021 09:00:51 +0000 (UTC) Date: Tue, 22 Jun 2021 11:00:51 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/101159 - fix missing NULL check in popcount pattern Message-ID: <76s38op2-1n8s-9213-7219-3s8841434nq4@fhfr.qr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.7 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Tue, 22 Jun 2021 09:00:53 -0000 This fixes a missing check for a NULL vectype in the new popcount pattern. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-06-22 Richard Biener PR tree-optimization/101159 * tree-vect-patterns.c (vect_recog_popcount_pattern): Add missing NULL vectype check. --- gcc/tree-vect-patterns.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/tree-vect-patterns.c b/gcc/tree-vect-patterns.c index 59727056dc7..d0a5c71dbe4 100644 --- a/gcc/tree-vect-patterns.c +++ b/gcc/tree-vect-patterns.c @@ -1385,9 +1385,9 @@ vect_recog_popcount_pattern (vec_info *vinfo, vect_pattern_detected ("vec_regcog_popcount_pattern", popcount_stmt); vec_type = get_vectype_for_scalar_type (vinfo, lhs_type); /* Do it only the backend existed popcount2. */ - if (!direct_internal_fn_supported_p (IFN_POPCOUNT, - vec_type, - OPTIMIZE_FOR_SPEED)) + if (!vec_type + || !direct_internal_fn_supported_p (IFN_POPCOUNT, vec_type, + OPTIMIZE_FOR_SPEED)) return NULL; /* Create B = .POPCOUNT (A). */ -- 2.26.2