From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id A55A93858C54 for ; Tue, 4 Apr 2023 11:36:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A55A93858C54 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=none smtp.mailfrom=kam.mff.cuni.cz Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 8CB4028A578; Tue, 4 Apr 2023 13:36:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1680608191; h=from:from:reply-to:subject:subject: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=raYnRcbDWkk90xJkQ3LbJ0ByueFHAnKupjM71afAMTo=; b=UrEdXHRyxTkz3wrWWKQ9G01WuOd/4/aaBaZiYA6lka1QCE2gRiOhzeWYbJLdSIIavr7Tck 3ve9yhy1A+OttyzjjE5pId/L2mzTo/h1Vf/t6kjBDnoWK5JMCXwSrBaKDT8NnvVF609VjY Vz/dnjlvUi6aS6Y5RQxrNvnW0W1FTI0= Date: Tue, 4 Apr 2023 13:36:31 +0200 From: Jan Hubicka To: Jakub Jelinek Cc: GCC Patches , Martin Jambor Subject: Re: Patch ping Re: [PATCH] ipa: Avoid another ICE when dealing with type-incompatibilities (PR 108959) Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > On Thu, Mar 23, 2023 at 11:09:19AM +0100, Martin Jambor wrote: > > Hi, > > > > PR 108959 shows one more example where undefined code with type > > incompatible accesses to stuff passed in parameters can cause an ICE > > because we try to create a VIEW_CONVERT_EXPR of mismatching sizes: > > > > 1. IPA-CP tries to push one type from above, > > > > 2. IPA-SRA (correctly) decides the parameter is useless because it is > > only used to construct an argument to another function which does not > > use it and so the formal parameter should be removed, > > > > 3. but the code reconciling IPA-CP and IPA-SRA transformations still > > wants to perform the IPA-CP and overrides the built-in DCE of > > useless statements and tries to stuff constants into them > > instead, constants of a type with mismatching type and size. > > > > This patch avoids the situation in IPA-SRA by purging the IPA-CP > > results from any "aggregate" constants that are passed in parameters > > which are detected to be useless. It also removes IPA value range and > > bits information associated with removed parameters stored in the same > > structure so that the useless information is not streamed later on. > > > > Bootstrapped and LTO-bootstrapped and tested on x86_64-linux. OK for > > trunk? > > > > gcc/ChangeLog: > > > > 2023-03-22 Martin Jambor > > > > PR ipa/108959 > > * ipa-sra.cc (zap_useless_ipcp_results): New function. > > (process_isra_node_results): Call it. > > > > gcc/testsuite/ChangeLog: > > > > 2023-03-17 Martin Jambor > > > > PR ipa/108959 > > * gcc.dg/ipa/pr108959.c: New test. OK, thanks! Honza