From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 44BD73858C56; Thu, 4 Apr 2024 12:12:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 44BD73858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1712232722; bh=J3chZran7Yk48HLgfc7KQvBxNqX6OeulJte17ovyFGs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VnFyGPCMr2BiNQyblW4nOndE8wGNzk7DCvpaBFvyzMup/FWfs3aCNAsSuRRstbKK0 vUm6jRVp+ViGzgkmfQvXA/xftKbK49OlZaqHWI0bSi/QsWTuFivuasI9yrEQ7Zs+cz fSvvBb7rSBrN6mU18SwtWLnfvtufkB9Vp+AhTK78= From: "jamborm at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/114247] RISC-V: miscompile at -O3 and IPA SRA Date: Thu, 04 Apr 2024 12:12:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ABI, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jamborm at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D114247 --- Comment #4 from Martin Jambor --- I don't seem to be able to get riscv64 qemu running in reasonable time. Can someone please verify that the following patch fixes the issue? diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc index 3e0df6a6f77..b4ca78b652e 100644 --- a/gcc/ipa-param-manipulation.cc +++ b/gcc/ipa-param-manipulation.cc @@ -740,6 +740,12 @@ ipa_param_adjustments::modify_call (cgraph_edge *cs, } if (repl) { + if (!useless_type_conversion_p(apm->type, repl->typed.type)) + { + repl =3D force_value_to_type (apm->type, repl); + repl =3D force_gimple_operand_gsi (&gsi, repl, + true, NULL, true, GSI_SAME_STMT); + } vargs.quick_push (repl); continue; }=