From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7110F3851C1A; Wed, 25 Nov 2020 21:33:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7110F3851C1A From: "joseph at codesourcery dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/97986] ICE in force_constant_size when applying va_arg to VLA type Date: Wed, 25 Nov 2020 21:33:19 +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: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: joseph at codesourcery dot com 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: 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: Wed, 25 Nov 2020 21:33:19 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97986 --- Comment #1 from joseph at codesourcery dot com --- I guess this should be handled like va_arg for float: give a warning about= =20 the type passed, then generate an abort (making sure that side-effects in=20 both arguments take effect before the abort, in case a side-effect=20 involves calling longjmp or exit). (Technically a fixed-size array type argument to va_arg could be used in=20 C90 mode to retrieve a non-lvalue array passed by value as a function=20 argument, but the result would just be another non-lvalue array with no=20 way to access the array elements, so just as useless as all other cases of= =20 non-lvalue arrays in C90. So although specifying any array type as the=20 second argument to va_arg is very dubious, maybe the case of a non-VLA in=20 C90 mode should not generate an abort.)=