From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CC941398795B; Thu, 17 Sep 2020 14:25:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CC941398795B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600352729; bh=DCtvnJxi1Z23PoDg+pff1M8Q/TY1SGIkOUUOcR0QkCA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=deceJcx6uejf/cs2E8HgMn0DAQHUk2v/mLSXJ4ErAqx4ULz4h8wxyuG/mRVFmJmof nS5zJs1XnE7u1GX2qv6lD5sH4q+nsXxxNMooebNXj4ESUYELBL9f8NXvcIXZUI5tvR Jwh4yXZB/oVWOD1/X9ydQWJ+Qpb50SbSg2S3Mwpg= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/94172] [arm-none-eabi] ICE in expand_debug_locations, at cfgexpand.c:5403 Date: Thu, 17 Sep 2020 14:25:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 8.3.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub 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: Thu, 17 Sep 2020 14:25:29 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94172 --- Comment #13 from CVS Commits --- The releases/gcc-8 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:cac1949a51e25360a7fd7dc8f473997b7ca048a9 commit r8-10470-gcac1949a51e25360a7fd7dc8f473997b7ca048a9 Author: Jakub Jelinek Date: Tue Mar 17 22:32:34 2020 +0100 c: Handle C_TYPE_INCOMPLETE_VARS even for ENUMERAL_TYPEs [PR94172] The following testcases ICE, because they contain extern variable declarations with incomplete enum types that is later completed and aft= er that those variables are accessed. The ICEs are because the vars then = may have incorrect DECL_MODE etc., e.g. in the first case the var has SImode DECL_MODE (the guessed mode for the enum), but the enum then actually h= as DImode because its enumerators don't fit into unsigned int. The following patch fixes it by using C_TYPE_INCOMPLETE_VARS not just on incomplete struct/union types, but also incomplete enum types. TYPE_VFIELD can't be used as it is TYPE_MIN_VALUE on ENUMERAL_TYPE, thankfully TYPE_LANG_SLOT_1 has been used in the C FE only on FUNCTION_TYPEs. 2020-03-17 Jakub Jelinek PR c/94172 * c-tree.h (C_TYPE_INCOMPLETE_VARS): Define to TYPE_LANG_SLOT_1 instead of TYPE_VFIELD, and support it on {RECORD,UNION,ENUMERAL}_TYPE. (TYPE_ACTUAL_ARG_TYPES): Check that it is only used on FUNCTION_TYPEs. * c-decl.c (pushdecl): Push C_TYPE_INCOMPLETE_VARS also to ENUMERAL_TYPEs. (finish_incomplete_vars): New function, moved from finish_struc= t.=20 Use relayout_decl instead of layout_decl. (finish_struct): Remove obsolete comment about C_TYPE_INCOMPLETE_VARS being TYPE_VFIELD. Use finish_incomplete_vars. (finish_enum): Clear C_TYPE_INCOMPLETE_VARS. Call finish_incomplete_vars. * c-typeck.c (c_build_qualified_type): Clear C_TYPE_INCOMPLETE_= VARS also on ENUMERAL_TYPEs. * gcc.dg/pr94172-1.c: New test. * gcc.dg/pr94172-2.c: New test. (cherry picked from commit 87ce34fa00cd6b87452d747235da40dfe5b6e00f)=