From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E3FF53858D28; Thu, 2 Dec 2021 09:07:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E3FF53858D28 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/103271] ICE in assign_stack_temp_for_type with -ftrivial-auto-var-init=pattern and VLAs and -mno-strict-align on riscv64 Date: Thu, 02 Dec 2021 09:07:47 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW 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 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: Thu, 02 Dec 2021 09:07:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103271 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ebotcazou at gcc dot gnu.o= rg, | |law at gcc dot gnu.org --- Comment #11 from Richard Biener --- (In reply to qinzhao from comment #10) > looks like that this is exactly the same issue as exposed in pr102285. >=20 > and the original fix to pr102285 just hide this inconsistent IR issue. >=20 > -mno-strict-align exposed this issue again. >=20 > So. I believe that we need to fix the inconsistent IR issue in order to > completely resolve this issue. The issue is simply that using build_zero_cst is "wrong" here in the sense that we know the size is constant but we hide that fact. In fact, C disallows initializing variable-sized objects, so an adjusted testcase with int fb[tw] =3D {}; is not valid C. I think the situation with risc-v is unfortunate since all other places in the compiler that zero non-memory simply use emit_move_insn from CONST0_RTX but that's not avilable since we do not go the "correct" path only because have_insn_for (SET, TImode) does not exist. But I'm not a target / RTL expert enough to tell whether that's a general problem that should be fixed. I also have no idea how to manually generate a proper zeroing sequence for the (reg:TI ..) pseudo the VLA typed aggregate expands to. I suppose assigning TImode to a decl but not even being able to move TImode can be a problem elsewhere...=