From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C2E48386F434; Tue, 21 Apr 2020 13:00:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2E48386F434 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587474032; bh=HFA0nwaD0OENsp8djLgt9Jb7Ow1dtN0rKHYiIaQwOvY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=SjwGx6yvzZLOlilPF6JK9K14DoNbzFlDC3mxoHRYlZVNO4Un354OYgUZsAmPxYude WSJDq0qjW5aNnMTtqrtzz+q5rU6EpmHgyk8PXZm9kUrbuoyeFM+yKSMW29EgXVVE6q /4AvfM5Vs9lrjHSm/sfbpYIMB61G4b4B2Uy498qo= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/93385] [10 Regression] wrong code with u128 modulo at -O2 -fno-dce -fno-ipa-cp -fno-tree-dce Date: Tue, 21 Apr 2020 13:00:32 +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: 10.0 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jamborm at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Apr 2020 13:00:32 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93385 --- Comment #32 from Jakub Jelinek --- For debug stmts when DCE isn't involved, we already seem to do the right th= ing, consider -O2 -g: __attribute__((noinline)) static void foo (int a) { int b =3D 2 * a; int c =3D 3 * a; a =3D a + 4; asm volatile ("" : : : "memory"); } void bar (void) { foo (1); foo (7); foo (16); } The clone materializes into: [local count: 1073741824]: # DEBUG D#5 s=3D> a # DEBUG a =3D> D#5 [local count: 1073741824]: # DEBUG D#1 s=3D> a # DEBUG BEGIN_STMT # DEBUG b =3D> D#1 * 2 # DEBUG BEGIN_STMT # DEBUG c =3D> D#1 * 3 # DEBUG BEGIN_STMT # DEBUG a =3D> D#1 + 4 # DEBUG BEGIN_STMT __asm__ __volatile__("" : : : "memory"); return; I thought only the first two debug stmts would appear, would need to look up where the a_1(D) is replaced with the D#1 copy and where the corresponding debug source bind is created. Bet we want similar testcase also for when this DCE is used, and no, debug stmts shouldn't be marked as something that should be thrown away, but inst= ead might be reset if we can't do anything better with them.=