From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id D28063857007 for ; Wed, 1 Jul 2020 11:24:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D28063857007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=richard.sandiford@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5315030E; Wed, 1 Jul 2020 04:24:30 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9B1013F73C; Wed, 1 Jul 2020 04:24:29 -0700 (PDT) From: Richard Sandiford To: Eric Botcazou Mail-Followup-To: Eric Botcazou , Jonathan Wakely , gcc-bugs@gcc.gnu.org, haoxintu@gmail.com, richard.sandiford@arm.com Cc: Jonathan Wakely , gcc-bugs@gcc.gnu.org, haoxintu@gmail.com Subject: Re: How GCC treats ice-on-invalid-code? References: <20200630143847.GA3488494@redhat.com> <2976657.y7V46JpDgB@polaris> Date: Wed, 01 Jul 2020 12:24:27 +0100 In-Reply-To: <2976657.y7V46JpDgB@polaris> (Eric Botcazou's message of "Wed, 01 Jul 2020 10:05:53 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.2 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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, 01 Jul 2020 11:24:32 -0000 Eric Botcazou writes: >> It's fine to file these ice-on-invalid bugs, but don't be surprised if >> nobody has time to work on bugs that are only triggered by unrealistic >> garbage input. > > Right, an ICE is a perfectly valid outcome for garbage input and there ar= e=20 > hundreds of assertions in the compiler precisely for this purpose. You mean, an ICE is perfectly valid as the first (and obviously then only) error diagnostic the compiler prints for =E2=80=9Cgarbage input=E2=80= =9D? If so, I don't think that's true. What counts as =E2=80=9Cgarbage=E2=80=9D= seems a bit too subjective for that anyway. E.g. deleting a chunk of lines from a file creates something that makes no sense and might be considered garbage, but that can easily happen with a botched resolution to a merge conflict (or being too trigger-happy with git rerere :-)). I don't think it's OK for the compiler simply to crash without first giving the user an idea of what's wrong. I agree ICEs are mostly OK as a downstream effect of an error that has already been reported, but in the context of the quote above, those cases are error-recovery rather than ice-on-invalid-code. Thanks, Richard