From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 012873858402; Mon, 4 Oct 2021 20:34:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 012873858402 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 20:34:02 +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 20:34:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102285 --- Comment #26 from qinzhao at gcc dot gnu.org --- (In reply to qinzhao from comment #25) > (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. >=20 > I guess the reason for it worked for you because you tested it after the > patch for 102587? >=20 > --- 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. */ because for the following IR: MEM[(int[0:D.1993] *)&fb.3] =3D .DEFERRED_INIT (16, 2, 1); The "var_type" of the LHS is "int[0:D.1993]", which is not an integer const= ant (even though the type for fb.3 should be the new type for the new temporary variable char[16]).=20 As a result, the new added check > + /* ??? Deal with poly-int sized registers. */ > + else if (tree_fits_uhwi_p (TYPE_SIZE_UNIT (var_type))) excluded it from expanding through expand_assign.=