This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]