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 E94CF3953804 for ; Fri, 27 May 2022 10:19:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E94CF3953804 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C85101F92B; Fri, 27 May 2022 10:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1653646756; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+hzwpOTqWHDmAQ8Qo3TG41qTkC1A+CcbaThoaYoJcw=; b=0WZostBefa6cJ9zNhym0jz2MqKN0K5nV5F0IpMzpBACaUXObDxAfuBIFemQLrkS/kPILUP PY9pmzA6QaCf75wnvQQHsKvK9j4EMhJf7Kzu+TBRqQFcK2RTFzBayrHeB502z2L/Yhk8+C 8XbyrmTMuyVZfvNPgl11qMij0K69aio= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1653646756; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=s+hzwpOTqWHDmAQ8Qo3TG41qTkC1A+CcbaThoaYoJcw=; b=cqL4dynChgQM+hOdXjEXhps5i8bgnafNVojmcBng+qrYEIZ3Xz5hGllOicUr9GFtZ9OnWt GJCGkra3m98PlBDw== Received: from suse.cz (unknown [10.100.200.98]) (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 A5E752C141; Fri, 27 May 2022 10:19:16 +0000 (UTC) From: Martin Jambor To: Richard Biener Cc: GCC Patches , Jan Hubicka Subject: Re: [PATCH] ipa: Check cst type when propagating controled uses info (PR 105639) In-Reply-To: References: User-Agent: Notmuch/0.35 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Fri, 27 May 2022 12:19:13 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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 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: Fri, 27 May 2022 10:19:19 -0000 Hi, On Fri, May 27 2022, Richard Biener wrote: > On Thu, May 26, 2022 at 4:47 PM Martin Jambor wrote: >> >> Hi, >> >> PR 105639 shows that code with type-mismatches can trigger an assert >> after runnning into a branch that was inteded only for references to >> variables - as opposed to references to functions. Fixed by moving >> the condition from the assert to the guarding if statement. >> >> Bootstrapped and tested on x86_64. OK for trunk and then gcc 12? > > OK. There's the same assert below - I guess that doesn't need the same > treatment? Thanks. The assert below also allows the case when cst is an ADDR_EXPR of a function. And the whole reference-counting is initiated only for these two cases. So in all other cases the condition rdesc->refcount != IPA_UNDESCRIBED_USE will be false. Martin >> >> >> gcc/ChangeLog: >> >> 2022-05-25 Martin Jambor >> >> PR ipa/105639 >> * ipa-prop.cc (propagate_controlled_uses): Check type of the >> constant before adding a LOAD reference. >> >> gcc/testsuite/ChangeLog: >> >> 2022-05-25 Martin Jambor >> >> PR ipa/105639 >> * gcc.dg/ipa/pr105639.c: New test.