RFC: Why don't we stop the optimizer pipeline when errorcount > 0?
Andrew Pinski
pinskia@physics.uc.edu
Mon Jan 9 19:42:00 GMT 2006
>
>
> 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
More information about the Gcc
mailing list