From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3498F3877039; Tue, 17 Mar 2020 10:33:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3498F3877039 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584441205; bh=HqDvwuwpTbzofilbLD8YiZTUsdczrtl65M+vzApleTk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FOZm+Ywq9qGVqdpB5IWIPvJYyHp+GwpGgNIaPEMSPrlA36Xjj2GujZPLQCS/+y+Oe e+ojqUOGWib5QGkF5EZJZootl+T/YpbYC/Kck8D0oUiHUy+GQh3ZeqBZdRMSY/bzXr zBPkxYgxj5obPq6nwT/4JA2S05Kh2jUBTpfZiw3M= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/51663] Desirable/undesirable elimination of unused variables & functions at -O0, -O0 -flto and -O0 -fwhole-program Date: Tue, 17 Mar 2020 10:33:25 +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: 4.7.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: hubicka 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 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, 17 Mar 2020 10:33:25 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51663 --- Comment #12 from Richard Biener --- (In reply to Tom de Vries from comment #11) > Cross-referencing PR gdb/25684 - "gdb testing with gcc -flto" ( > https://sourceware.org/bugzilla/show_bug.cgi?id=3D25684 ). >=20 > Ideally there would be a way to enable the lto infrastructure without > actually optimizing, such that when running the gdb testsuite with and > without flto and comparing results, any regression would indicate somethi= ng > that needs fixing. >=20 > In the current situation, each individual regression needs investigation > whether something needs fixing or whether the failure is just an > optimization artifact. And due to the fact there are optimizations, there > are thousands of such regressions. I suppose we're talking about -O0 -flto here. What kind of transforms are undesirable? I think at -O0 you'll get - more aggressive unused variable/function removal - promotion of variables from global to local some of the transforms are unavoidable due to partitioning(?) but we could default to 1:1 partitioning at -O0 ...=