From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4AFD93849AD3; Fri, 19 Apr 2024 14:58:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4AFD93849AD3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713538712; bh=3mif8bDgxXV09kp2YlXxLqvJOgwsrio5/BjyDRwt6s0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wQ+BeAouuipsqQu/sLnDa8ryz8vYOiIO6DHkDZHscGgwAWg9ihG9nLBfbUXn0o2th TidG/OMuH6C49K3UCfBIRZVOAqDsmMQR6AlikL0dzHZVzPtDM2pLNFWtU4pmsW1nai SDNtjesxvAWCpo53X5Xar6CBe8Y0WnsFq/YIkb3M= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113964] [11/12/13/14/15 Regression] repeat copy of struct Date: Fri, 19 Apr 2024 14:58:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113964 --- Comment #6 from GCC Commits --- The releases/gcc-13 branch has been updated by Martin Jambor : https://gcc.gnu.org/g:5c3238b0d55ec13a2430aa606e2bfed9432e97ac commit r13-8620-g5c3238b0d55ec13a2430aa606e2bfed9432e97ac Author: Martin Jambor Date: Fri Apr 19 16:48:12 2024 +0200 ipa: Force args obtined through pass-through maps to the expected type = (PR 113964) 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. 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. (cherry picked from commit 8cd0d29270d4ed86c69b80c08de66dcb6c1e22fe)=