From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 12BFB3858D32 for ; Mon, 12 Jun 2023 13:19:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 12BFB3858D32 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-out1.suse.de (Postfix) with ESMTPS id 4032022853 for ; Mon, 12 Jun 2023 13:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686575943; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RYOG2wwZL5/CKTQuUZjYiE5cjDB49lSSJpOYuJXCG20=; b=S7u5BdxTJKA468T/A1UEcwJQT72x0BKNf35YS1KCKXAd9vZ2qeaTjKku82xcBu5kQKMvB9 1UNZQ7MECfiifjKPJxMS5OFMGqqrg1/X7G9bXtYUfhqQtte1M0/0TbNF9vIoqUtbtXDMpI JukmcC2ngk8EAzJiNEfX0ZVlYB5fDE0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686575943; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=RYOG2wwZL5/CKTQuUZjYiE5cjDB49lSSJpOYuJXCG20=; b=qv8oMhq2NizGxjxQiqW/5f6HCAxmxDxpkUxBdp/FSBNiod6b2Lv1VtFmWMzVzSffgtwF47 xRKr5lzQUUSsiGAA== 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 2C776138EC for ; Mon, 12 Jun 2023 13:19:03 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id LDGTCUcbh2ScfgAAMHmgww (envelope-from ) for ; Mon, 12 Jun 2023 13:19:03 +0000 Date: Mon, 12 Jun 2023 15:19:02 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Fix disambiguation against .MASK_STORE MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20230612131903.2C776138EC@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.5 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: Alias analysis was treating .MASK_STORE as storing a full vector which means we disambiguate against decls of smaller than vector size. That's of course wrong and a similar issue was fixed for DSE already. The following makes sure we set the size of the access to unknown and only constrain max_size. This fixes runtime execution FAILs of gfortran.dg/matmul_2.f90, gfortran.dg/matmul_6.f90 and gfortran.dg/pr91577.f90 when using AVX512 with full masked loop vectorization on Zen4. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed to trunk sofar. * tree-ssa-alias.cc (call_may_clobber_ref_p_1): For .MASK_STORE and friend set the size of the access to unknown. --- gcc/tree-ssa-alias.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/tree-ssa-alias.cc b/gcc/tree-ssa-alias.cc index 79ed956e300..b5476e8b41e 100644 --- a/gcc/tree-ssa-alias.cc +++ b/gcc/tree-ssa-alias.cc @@ -3072,6 +3072,9 @@ call_may_clobber_ref_p_1 (gcall *call, ao_ref *ref, bool tbaa_p) ao_ref lhs_ref; ao_ref_init_from_ptr_and_size (&lhs_ref, gimple_call_arg (call, 0), TYPE_SIZE_UNIT (TREE_TYPE (rhs))); + /* We cannot make this a known-size access since otherwise + we disambiguate against stores to decls that are smaller. */ + lhs_ref.size = -1; lhs_ref.ref_alias_set = lhs_ref.base_alias_set = tbaa_p ? get_deref_alias_set (TREE_TYPE (gimple_call_arg (call, 1))) : 0; -- 2.35.3