From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id AF1F83858D37 for ; Wed, 24 Jan 2024 15:23:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF1F83858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF1F83858D37 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=1706109824; cv=none; b=jjFs4lB4DqDIYtg/gxw1slAOXwcCrtNIStPjq5S2Wru5E4qqEFSaMpVjAJ4X6qAtsomKArtgf5cVBFpYXyv5Bf8wWFJRRhJo91r9ndaA5jiX5j+dPJB5mRwYxLOVLhRPeSTvrS/9a37lB2hKhKl7xcEJgd/ATcKF+jiM345HM9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706109824; c=relaxed/simple; bh=ZKlpfMkpA3apHVRLAK3F0j9lle9nBIll075Ldy3huOk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-ID:MIME-Version; b=RnvrRhng0LTMCxvrvg/sDgpfXq8f+wBYcgYsdfbS12I1fbSZ264piFIpzJUlB46higm+DYrmyv+CGNqpT8KbVMqTaiEO3s8AGaRzyUJ9ODmqrHIxsBwXx392xr+x9Kc8vrHriXsPavooGBt72aNVGsAHhUZOCyRr8WoEUztajzg= 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 91FE31F7F8 for ; Wed, 24 Jan 2024 15:23:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706109819; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z1jP1tPVhs6CUuRf6Ol4sat2NeynBwz9hI8Eu2EebWk=; b=uz14TAFkyxAhNLRHdeeJf+WPdlBZBsxGMsewdCxqH47ZpEnA9vOD63TJxHvaVMFfxBDb+/ Jexlzool13Sm1BaUGroFR3bdLbUq01o/pr23q4puYZzkrOEfBwveRPBbE65BVS5TtZhKzc w/Yt77rAmFjA4ico8H4tw69MuYsfbLw= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706109819; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z1jP1tPVhs6CUuRf6Ol4sat2NeynBwz9hI8Eu2EebWk=; b=CBDtHMgJaSLcXKy7FQ36g3oJfKVl0qxZqOL9rF08C9Y3a9nuFVN1avpKtR86w4LoiPJcB5 liPh8VoET33kMOBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1706109818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z1jP1tPVhs6CUuRf6Ol4sat2NeynBwz9hI8Eu2EebWk=; b=t4oxuOm8tBzYiuhDZOENdIEdKC/5Rpijcoy57lkX5SnwDI48mFqjn+W20e7cNViC0NVaSu +G8AN7LR69x2M6x0sjxV5JGRlTYikg3a/kCmDxq6VI/q2j8MqzgHPPHo0P3aEeRRDshlS7 hNOLvPTM7JBg1A8T3YpjZ9F1CQEgEgY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1706109818; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=z1jP1tPVhs6CUuRf6Ol4sat2NeynBwz9hI8Eu2EebWk=; b=1oTs1Hk4KfVy2EHtXoZFXQ2MnRyWh5hHHXPvvi+ywWwCpB1OGwLFg3DgYEYMp3UUdI2r6c 78yXbJ9VrUZgTuDQ== 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 8015C13786 for ; Wed, 24 Jan 2024 15:23:38 +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 XOQ9H3orsWVNDgAAD6G6ig (envelope-from ) for ; Wed, 24 Jan 2024 15:23:38 +0000 From: Martin Jambor To: GCC Patches Subject: Re: [PATCH] ipa-cp: Fix check for exceeding param_ipa_cp_value_list_size (PR 113490) In-Reply-To: References: User-Agent: Notmuch/0.38.1 (https://notmuchmail.org) Emacs/29.1 (x86_64-suse-linux-gnu) Date: Wed, 24 Jan 2024 16:23:34 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=t4oxuOm8; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=1oTs1Hk4 X-Spamd-Result: default: False [-1.11 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_HAS_DN(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+]; MX_GOOD(-0.01)[]; TO_DN_ALL(0.00)[]; INVALID_MSGID(1.70)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[ipa-cp.cc:url,suse.cz:dkim,suse.cz:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 91FE31F7F8 X-Spam-Level: X-Spam-Score: -1.11 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,INVALID_MSGID,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: Hi, On Mon, Jan 22 2024, Jan Hubicka wrote: >> Hi, >> >> When the check for exceeding param_ipa_cp_value_list_size limit was >> modified to be ignored for generating values from self-recursive >> calls, it should have been changed from equal to, to equals toor is >> greater than. This omission manifests itself as PR 113490. >> >> When I examined the condition I also noticed that the parameter should >> come from the callee rather than the caller, since the value list is >> associated with the former and not the latter. In practice the limit >> is of course very likely to be the same, but I fixed this aspect of >> the condition too. I briefly audited all other uses of opt_for_fn in >> ipa-cp.cc and all the others looked OK. >> >> Bootstrapped and tested on x86_64-linux. OK for master? >> >> Thanks, >> >> Martin >> >> >> gcc/ChangeLog: >> >> 2024-01-19 Martin Jambor >> >> PR ipa/113490 >> * ipa-cp.cc (ipcp_lattice::add_value): Bail out if value >> count is equal or greater than the limit. Use the limit from the >> callee. >> >> gcc/testsuite/ChangeLog: >> >> 2024-01-19 Martin Jambor >> >> PR ipa/113490 >> * gcc.dg/ipa/pr113490.c: New test. > OK, > thanks! thank you, I have pushed the following, which has a tweak in the added test so that it is only run on targets which support the required vectors. Martin When the check for exceeding param_ipa_cp_value_list_size limit was modified to be ignored for generating values from self-recursive calls, it should have been changed from equal to, to equals to or is greater than. This omission manifests itself as PR 113490. When I examined the condition I also noticed that the parameter should come from the callee rather than the caller, since the value list is associated with the former and not the latter. In practice the limit is of course very likely to be the same, but I fixed this aspect of the condition too. I briefly audited all other uses of opt_for_fn in ipa-cp.cc and all the others looked OK. gcc/ChangeLog: 2024-01-19 Martin Jambor PR ipa/113490 * ipa-cp.cc (ipcp_lattice::add_value): Bail out if value count is equal or greater than the limit. Use the limit from the callee. gcc/testsuite/ChangeLog: 2024-01-22 Martin Jambor PR ipa/113490 * gcc.dg/ipa/pr113490.c: New test. --- gcc/ipa-cp.cc | 2 +- gcc/testsuite/gcc.dg/ipa/pr113490.c | 31 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr113490.c diff --git a/gcc/ipa-cp.cc b/gcc/ipa-cp.cc index b1e2a3a829a..e85477df32d 100644 --- a/gcc/ipa-cp.cc +++ b/gcc/ipa-cp.cc @@ -2298,7 +2298,7 @@ ipcp_lattice::add_value (valtype newval, cgraph_edge *cs, return false; } - if (!same_lat_gen_level && values_count == opt_for_fn (cs->caller->decl, + if (!same_lat_gen_level && values_count >= opt_for_fn (cs->callee->decl, param_ipa_cp_value_list_size)) { /* We can only free sources, not the values themselves, because sources diff --git a/gcc/testsuite/gcc.dg/ipa/pr113490.c b/gcc/testsuite/gcc.dg/ipa/pr113490.c new file mode 100644 index 00000000000..526e22b3787 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr113490.c @@ -0,0 +1,31 @@ +/* { dg-do compile { target int128 } } */ +/* { dg-options "-O3 -Wno-psabi" } */ + +typedef char A __attribute__((vector_size (64))); +typedef short B __attribute__((vector_size (64))); +typedef unsigned C __attribute__((vector_size (64))); +typedef long D __attribute__((vector_size (64))); +typedef __int128 E __attribute__((vector_size (64))); + +D bar1_D_0; +E bar4 (A, D); + +E +bar1 (C C_0) +{ + C_0 >>= 1; + bar4 ((A) C_0, bar1_D_0); + bar4 ((A) (E) {~0 }, (D) (A){ ~0 }); + bar4 ((A) (B) { ~0 }, (D) (C) { ~0 }); + bar1 ((C) (D) { 0, ~0}); + bar4 ((A) C_0, bar1_D_0); + (A) { bar1 ((C) { 7})[5] - C_0[63], bar4 ((A) (D) {~0}, (D) (C) { 0, ~0})[3]}; +} + +E +bar4 (A A_0, D D_0) +{ + bar1 ((C) A_0); + bar1 ((C) {5}); + bar1 ((C) D_0); +} -- 2.43.0