This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Why don't we stop the optimizer pipeline when errorcount > 0?
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: dnovillo at redhat dot com (Diego Novillo)
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 9 Jan 2006 14:42:30 -0500 (EST)
- Subject: Re: RFC: Why don't we stop the optimizer pipeline when errorcount > 0?
>
>
> I hit an ICE inside an optimizer pass because the code had a glaring syntax
> error that we diagnosed correctly, but since we kept going, the
> transformation didn't find the CFG in the assumed state, causing the ICE.
We do stop the optimization passes from running in general.
/* Gate: execute, or not, all of the non-trivial optimizations. */
static bool
gate_all_optimizations (void)
{
return (optimize >= 1
/* Don't bother doing anything if the program has errors. */
&& !(errorcount || sorrycount));
}
tatic bool
gate_rest_of_compilation (void)
{
/* Early return if there were errors. We can run afoul of our
consistency checks, and there's not really much point in fixing them. */
return !(rtl_dump_and_exit || flag_syntax_only || errorcount || sorrycount);
}
> Is there any reason in particular we don't just make the gate functions
> return false when errorcount > 0?
the only passes which do run are cfg creation, expand, and maybe a couple other
simple ones.
-- Pinski