From patchwork Fri Sep 27 12:50:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1990274 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQQjkmBq; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xBK6ufxZ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQQjkmBq; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=xBK6ufxZ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XFVhh5X35z1xt8 for ; Fri, 27 Sep 2024 22:51:31 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DF942385B82F for ; Fri, 27 Sep 2024 12:51:28 +0000 (GMT) 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 [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 5492E3858C52 for ; Fri, 27 Sep 2024 12:50:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5492E3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5492E3858C52 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727441469; cv=none; b=hba2iwEmLGBUfPb+XkT+vq65+cSVhD+c3f4M/DVEC3cPJKwFppFyTJ26cuCuOIiLd+CSFdoOaozzqAP0vT445BVmh3k/ODvfKOuWrknagd8DI8q9b1Mw7RZXcSDqxEECkwRftF2dsCaqqN53ONs8wh+l2CeE9cBDjJTSPPD86aM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727441469; c=relaxed/simple; bh=UCZ4ljy8ev5kFWZpoObuirK1PfNsWLgANdBOyZCt/TU=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=c2mFGdCMq2684XlaIgWPlSBYlO+yztg/uulcEoSfM1CoMHoL4EEaVBl9ea8hmymyt9BPUUsSFYGhNcv3eSbFCUj1GjntxAGRzeue9aCJQA012+yuhGzZe1u/IOdyc2GvPKTjgJMeNkMBvwJY8xrShRk7Zev/zeSaFqzTxveJk14= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 455711FDA6 for ; Fri, 27 Sep 2024 12:50:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727441458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3ryGMe2i8+Euu4jopguJlWsuhQdILfuiwDzEZVDfBVo=; b=PQQjkmBqMsXtjzLIvrc8LU/eKzYtxDLcijJwjVH2+ria8FBRe0KBdIT/5Gc4vJmKR23LVN zyUxRQ0eu6u2IKBppK72eXzDgHuVHCMEK2Z/74Kef4PeK89EtO0zftP7YN5qJBITgnfKaj bzsJ6i7jGAQvpFfqOFfuhdkexLoNcMg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727441458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3ryGMe2i8+Euu4jopguJlWsuhQdILfuiwDzEZVDfBVo=; b=xBK6ufxZz2aqYe9Z4yihGlI8Kakq0kiPRoKQTNR5cljUpSkmabxLGY5GNSvzsIs3z8mD9i HOC310JWw0n+/3Dg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=PQQjkmBq; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=xBK6ufxZ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1727441458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3ryGMe2i8+Euu4jopguJlWsuhQdILfuiwDzEZVDfBVo=; b=PQQjkmBqMsXtjzLIvrc8LU/eKzYtxDLcijJwjVH2+ria8FBRe0KBdIT/5Gc4vJmKR23LVN zyUxRQ0eu6u2IKBppK72eXzDgHuVHCMEK2Z/74Kef4PeK89EtO0zftP7YN5qJBITgnfKaj bzsJ6i7jGAQvpFfqOFfuhdkexLoNcMg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1727441458; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=3ryGMe2i8+Euu4jopguJlWsuhQdILfuiwDzEZVDfBVo=; b=xBK6ufxZz2aqYe9Z4yihGlI8Kakq0kiPRoKQTNR5cljUpSkmabxLGY5GNSvzsIs3z8mD9i HOC310JWw0n+/3Dg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 2BF2F1386E for ; Fri, 27 Sep 2024 12:50:58 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id aecFCTKq9mYnCAAAD6G6ig (envelope-from ) for ; Fri, 27 Sep 2024 12:50:58 +0000 Date: Fri, 27 Sep 2024 14:50:53 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/116785 - relax volatile handling in PTA MIME-Version: 1.0 Message-Id: <20240927125058.2BF2F1386E@imap1.dmz-prg2.suse.org> X-Rspamd-Queue-Id: 455711FDA6 X-Spam-Level: X-Spamd-Result: default: False [-6.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -6.51 X-Spam-Status: No, score=-11.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.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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org When there's volatile qualified stores we do not have to treat the destination as pointing to ANYTHING. It's only when reading from it that we want to treat the resulting pointers as pointing to ANYTHING. Bootstrapped and tested on x86_64-unknown-linux-gnu. Richard. PR tree-optimization/116785 * tree-ssa-structalias.cc (get_constraint_for_1): Only volatile qualified reads produce ANYTHING. --- gcc/tree-ssa-structalias.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index d6a53f801f0..54c4818998d 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -3646,7 +3646,7 @@ get_constraint_for_1 (tree t, vec *results, bool address_p, } case tcc_reference: { - if (TREE_THIS_VOLATILE (t)) + if (!lhs_p && TREE_THIS_VOLATILE (t)) /* Fall back to anything. */ break; @@ -3751,7 +3751,7 @@ get_constraint_for_1 (tree t, vec *results, bool address_p, } case tcc_declaration: { - if (VAR_P (t) && TREE_THIS_VOLATILE (t)) + if (!lhs_p && VAR_P (t) && TREE_THIS_VOLATILE (t)) /* Fall back to anything. */ break; get_constraint_for_ssa_var (t, results, address_p);