From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 359633858D28; Tue, 2 May 2023 16:47:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 359633858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683046020; bh=O7a80esU871syp5nyF9a1D31NZ2VQjRmnrX3Wda21vw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OnFrmqWWXQ9W/UqLyQVTBYkfNguDymjByeADWe2MIA2hvmZOAYVYSXas1MU/8BE1G tO0bcEvgm4jThoy8wpr3KlB1qim31n4/k46PIDfv5ObMDMxH4GqyD4q2qFG5FhfzbD J54wCQ06NBkAD9Vbnp8RwgABnajAfQ9eMtTloEWs= From: "gjl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/109650] avr-gcc incorrect code with -Os Date: Tue, 02 May 2023 16:46:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: gjl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D109650 Georg-Johann Lay changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |saaadhu at gcc dot gnu.org --- Comment #6 from Georg-Johann Lay --- As it appears, disabling avr.cc's machine dependent reorg by means of -fdisable-rtl-mach can stop this PR. Maybe avr.cc::avr_reorg() is no more correct after PR92729 because contrary to cc0, now a branch instruction may have more than one CCmode setter. A part of this optimization could be run prior to .split2 when cbranch insns are still intact. In particular transformations like from "if (x <=3D 2)" to "if (x < 3)" must be performed= on cbranch, or otherwise avr_reorg() must check that there is only one CCmode setter, or otherwise adjust *all* CCmode setters. This optimization should not run too early so that avr_reorg_remove_redundant_compare can still do its job on switch-case if-e= lse trees. I am allowing me to add Senthil to CC, maybe he has some ideas.=