From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E6903858C39; Thu, 29 Feb 2024 19:19:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E6903858C39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709234386; bh=xLD2ecAezPcFCeZUD5Xmn5gpeTSbtjdlnQtCgM8pfGI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=DyTOfAXPVmclGkPt8u02eImewH4wwM+6kxBMz6etwAEHN6v8smrtPw8ANL8nV2Uij Jf3hyaTV/axFp4mz8yJC5VDlp+19aKrloIPzwi7y9Z1gzAW4buDqMGf2OO+x3Sejcg Cg+l7y4joIXr9YlmuDZJYvhse+AmNLwN3CV5vmHQ= From: "qinzhao at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111523] Unexpected performance regression with -ftrivial-auto-var-init=zero for e.g. systemctl unmask Date: Thu, 29 Feb 2024 19:19:43 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: qinzhao at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED 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=3D111523 qinzhao at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |qinzhao at gcc dot gnu.org --- Comment #2 from qinzhao at gcc dot gnu.org --- (In reply to Hans-Peter Nilsson from comment #0) thanks for filing this bug, and sorry for the late reply (I might miss the original notification of this bug when it was opened last year) from the description of the bug, it's not very clear on how to reproduce the performance regression step by step.=20 As a compiler engineer working in performance analysis for quite some years= , I suggest to use some performance analysis tools to locate the exact routines= in systemd that contribute to the regression. After these specific routines th= at contribute to the major regression are identified, we can further narrow do= wn to the root cause, usually the following possibilities: 1. some large local array or local structure were initialized by this optio= n, the additional initialization insns cannot be eliminated by compiler optimization.=20 if this is the case, we can add the following attribute: "uninitialized This attribute, attached to a variable with automatic storage, means that t= he variable should not be automatically initialized by the compiler when the option -ftrivial-auto-var-init presents. " to prevent those local array or structure variables from auto-initializatio= n.=20 2. there are some missing compiler optimization opportunities which should = be enabled to eliminate the overhead.=