From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 60D933858412; Thu, 23 Feb 2023 10:15:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60D933858412 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677147356; bh=A0NBM862RDt/QFlhFLdN0Newr2jquwsiKtPRzDs/SgQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=q9v4qfUBRrvTBnBvm6mk9JfYod32sE0ZHdFbyNQpcl/AUzBn5+NLFwThTjrlPHrL1 uHSjW7IGL1e3nz6SZVppgK+L5fqAC6Tim5Apk/MA/Uo8+X5SkvIKrDgJ8OL2ahi/rk SBxw5r/7nc1bcBj1XlUI1u22VItHMfmtw3xy1Nzk= From: "tkapela at poczta dot fm" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/106921] [11/12/13 Regression] -O1 and -fipa-icf -fpartial-inlining causes wrong code since r11-4987-g602c6cfc79ce4ae6 Date: Thu, 23 Feb 2023 10:15:53 +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: 11.3.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: tkapela at poczta dot fm X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.4 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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=3D106921 Tomasz Kapela changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tkapela at poczta dot fm --- Comment #6 from Tomasz Kapela --- I think I encounter the same issue with my library code. Simplified example= is here=20 https://github.com/tomasz-kapela/DMapProblem Incorrect output appears only with -O2 flag on GCC 10, 11, 12. Also turning off partial inlining optimalization solves the problem:=20 -O2 -fno-partial-inlining=20 I have checked that on GCC 8.4 with -O2 the output is correct. Replacing lines 75-78 in include/capd/autodiff/EvalSub.h: if(coeffNo) result[coeffNo] =3D -right[coeffNo]; else *result =3D *left - *right; with result[coeffNo] =3D (coeffNo!=3D0) ? -right[coeffNo] : *left - *right; produce correct output. Should I post it as a separate bug report?=