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 DF52B3858415 for ; Fri, 5 Apr 2024 12:54:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF52B3858415 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=ucw.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kam.mff.cuni.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DF52B3858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.113.20.16 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712321691; cv=none; b=w0FvX4P2zLJBGIaAWglz5u8c/lMRuiY7uGMv6LaZa24UleulbFLxpzd/+OFmBGeQ7K9DKqdODg9/7LAn7B7E4pF5Pp5rLBxwQUMusrLHCfua6A7DMFSfu4K3WozbOeHlN+6Ay+oFG8ISAU199tgp7qXSUxmfyaxVeAGWNygZ8rA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712321691; c=relaxed/simple; bh=BTXAC1lMdcy4aTgnvLJqr/1hT8JiS+B8YvTdRtzxuvM=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=Po8BtTdSdWHmPQdoA15ONjFkAxN1utJ7yLHvUu05OMQ2yRO7Hm/BXQbHIM6LYmDOr8V3sFGgC4EuiLcsF1SSqz1jjBPPdzLkJRkmriBVpzWYcd53ftYD9xsrrT1G7PwBJemMF/TRpSeyjwbaEYpRP0/lKm9muVVvZoRj7GGnJaE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 5806E2861A6; Fri, 5 Apr 2024 14:54:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ucw.cz; s=gen1; t=1712321688; 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=Hoa06MlENYljVuyPMkbVVZbtwAeGGRDgmGSbFlmjFZo=; b=kxHBLULReDzklTnwid/ZpXJqNGYE2RNMuvcUssl5YeAYov8rxjdIapUcBHpr7Qzo7Evxpe bEpchiDO1vQg5CFMU/LuQzjsFqxqnLtd9GzqbaEoMCeSmEr++HCv/+OS/ve+HpSifac7xc gzt53IsoXvhFiVoG3yIr2kDZjDxxU8c= Date: Fri, 5 Apr 2024 14:54:48 +0200 From: Jan Hubicka To: Martin Jambor Cc: GCC Patches Subject: Re: [PATCH] ipa: Force args obtined through pass-through maps to the expected type (PR 113964) 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=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,JMQ_SPF_NEUTRAL,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,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: > Hi, > > interactions of IPA-CP and IPA-SRA on the same data is a rather big > source of issues, I'm afraid. PR 113964 is a situation where IPA-CP > propagates an unsigned short in a union parameter into a function > which itself calls a different function which has a same union > parameter and both these union parameters are split with IPA-SRA. The > leaf function however uses a signed short member of the union. > > In the calling function, we get the unsigned constant as the > replacement for the union and it is then passed in the call without > any type compatibility checks. Apparently on riscv64 it matters > whether the parameter is signed or unsigned short and so the leaf > function can see different values. > > Fixed by using useless_type_conversion_p at the appropriate place and > if it fails, use force_value_to type as elsewhere in similar > situations. > > Bootstrapped and tested on x86_64-linux, the reporter has also run the > testsuite with this patch on riscv64 and reported in Bugzilla there were > no issues. > > OK for master and GCC 13? > > Thanks, > > Martin > > > gcc/ChangeLog: > > 2024-04-04 Martin Jambor > > PR ipa/113964 > * ipa-param-manipulation.cc (ipa_param_adjustments::modify_call): > Force values obtined through pass-through maps to the expected > split type. > > gcc/testsuite/ChangeLog: > > 2024-04-04 Patrick O'Neill > Martin Jambor > > PR ipa/113964 > * gcc.dg/ipa/pr114247.c: New test. OK, thanks! Honza