This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][LTO] Committed patch to fix a crash due to syntax error.
- From: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Diego Novillo" <dnovillo at google dot com>
- Date: Thu, 9 Oct 2008 09:56:17 +0200
- Subject: Re: [PATCH][LTO] Committed patch to fix a crash due to syntax error.
- References: <498552560810090000g61998990ya18663c803439518@mail.gmail.com>
On Thu, Oct 9, 2008 at 9:00 AM, Doug Kwan (關振紱) <dougkwan@google.com> wrote:
> I have just commited this trivial patch to make
> gimple_try_catch_may_fallthru more robust in the presence of syntax
> errors in input.
Does this mean -flto writes out translation units which contain
errors?
Thanks,
Richard.
> -Doug
>
> Index: gcc/gcc/ChangeLog.lto
> ===================================================================
> --- gcc/gcc/ChangeLog.lto (revision 140999)
> +++ gcc/gcc/ChangeLog.lto (working copy)
> @@ -1,3 +1,8 @@
> +2008-10-09 Doug Kwan <dougkwan@google.com>
> +
> + * gimple-low.c (gimple_try_catch_may_fallthru): Check for empty
> + clean-up GIMPLE sequence.
> +
> 2008-10-08 Rafael Espindola <espindola@google.com>
>
> * lto-tree-in.h (lto_symtab_get_resolution): New.
> Index: gcc/gcc/gimple-low.c
> ===================================================================
> --- gcc/gcc/gimple-low.c (revision 140999)
> +++ gcc/gcc/gimple-low.c (working copy)
> @@ -453,6 +453,15 @@ gimple_try_catch_may_fallthru (gimple st
> return true;
>
> i = gsi_start (gimple_try_cleanup (stmt));
> +
> + /* If we have a syntax error, the cleanup sequence can be empty.
> + Return FALSE instead of crashing the compiler. */
> + if (gsi_end_p (i))
> + {
> + gcc_assert (errorcount);
> + return false;
> + }
> +
> switch (gimple_code (gsi_stmt (i)))
> {
> case GIMPLE_CATCH:
>