I bet it does preserve some errors. I noticed that when I analyzed a bit
PR40405, see Comment #3 in particular.
On Mon, Mar 26, 2012 at 10:56 PM, Steven Bosscher<stevenb....@gmail.com> wrote:
This patch is one way to address PR44982. I see no good reason to
cgraph_finalize_compilation_unit if there were parse errors. As Richi
already pointed out, GCC traditionally has proceeded after parse
errors to preserve warnings and errors we generate from the middle-end
and during semantic analysis. But it seems to me that those warnings
are not very meaningful after parse errors (-Wuninitialized after a
parse error??), and errors from the middle end are mostly for exotic
code (involving asm()s and the like). Bailing out after parse errors
is therefore IMHO the right thing to do for the common case.
Conceptually it makes sense. Did you check whether allowing the
FE too proceed to final_write_globals but stop before
preserves any errors? I would expect that maybe FE global variable
diagostics are defered until that? It would be nice to finally move
the call to cgraph_finalize_compilation_unit to the middle-end ...
(warning, if you try that you run into an issue with the Java frontend ... :/)