From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 969DA3858407; Mon, 4 Oct 2021 17:16:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 969DA3858407 From: "qinzhao at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/102285] New flag -ftrivial-auto-var-init=zero causes crash in pr82421.c Date: Mon, 04 Oct 2021 17:16:36 +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.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: qinzhao at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth 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: Mon, 04 Oct 2021 17:16:36 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102285 --- Comment #25 from qinzhao at gcc dot gnu.org --- (In reply to Richard Biener from comment #22) > Hmm, my proposed patch seems to work. I've adjusted it to not regress > previously correctly handled cases and will test it fully. I guess the reason for it worked for you because you tested it after the pa= tch for 102587? --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -3035,7 +3035,8 @@ expand_DEFERRED_INIT (internal_fn, gcall *stmt) /* Expand this memset call. */ expand_builtin_memset (m_call, NULL_RTX, TYPE_MODE (var_type)); } - else + /* ??? Deal with poly-int sized registers. */ + else if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (var_type))) { /* If this variable is in a register, use expand_assignment might generate better code. */=