public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Eric Botcazou <ebotcazou@libertysurf.fr>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	gcc-bugs@gcc.gnu.org, haoxintu@gmail.com
Subject: Re: How GCC treats ice-on-invalid-code?
Date: Wed, 01 Jul 2020 12:24:27 +0100	[thread overview]
Message-ID: <mpto8oztr4k.fsf@arm.com> (raw)
In-Reply-To: <2976657.y7V46JpDgB@polaris> (Eric Botcazou's message of "Wed, 01 Jul 2020 10:05:53 +0200")

Eric Botcazou <ebotcazou@libertysurf.fr> 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 are 
> 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 “garbage input”?
If so, I don't think that's true.  What counts as “garbage” 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


  reply	other threads:[~2020-07-01 11:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30  2:32 Haoxin Tu
2020-06-30  3:09 ` Haoxin Tu
2020-06-30 14:28   ` Jonathan Wakely
2020-06-30 13:22 ` Richard Sandiford
2020-06-30 14:38   ` Jonathan Wakely
2020-07-01  8:05     ` Eric Botcazou
2020-07-01 11:24       ` Richard Sandiford [this message]
2020-07-02  8:51         ` Eric Botcazou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mpto8oztr4k.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=ebotcazou@libertysurf.fr \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=haoxintu@gmail.com \
    --cc=jwakely@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).