This is the mail archive of the gcc-patches@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: [C PATCH] Fix C error-recovery (PR c/69796, PR c/69974)


On Fri, Feb 26, 2016 at 02:45:38PM -0700, Jeff Law wrote:
> >2016-02-26  Jakub Jelinek  <jakub@redhat.com>
> >
> >	PR c/69796
> >	PR c/69974
> >	* c-parser.c (c_parser_translation_unit): Don't change TREE_TYPE
> >	of incomplete decls to error_mark_node.
> >
> >	* gcc.dg/pr69796.c: New test.
> >	* gcc.dg/pr69974.c: New test.
> This one leaves the type incomplete, right?  So ISTM it's somewhat more

Yes.

> likely than the second to expose other errors later with code that doesn't
> expect the type to be incomplete (much like other code doesn't expect to
> find error_mark_node in here).

Well, we were without the error in the FE for many years, the error has been
diagnosed only very late (during assemble_variable) and I'm not aware of
ICEs because of that.  The c-parser.c change to add the error has been done
only to error also in -fsyntax-only mode.  So while there is some risk, I
think it is very low.

> The second patch at least puts a real type in there.  I suspect that's less
> likely to cause problems downstream, except perhaps with diagnostics.

Yeah, I'm worried some code might be upset when it compares the types and
gets upset that they aren't compatible or something similar.

> I'll conditionally approve -- if nobody objects in 72hrs, consider the first
> patch OK for the trunk.

Ok, will wait.

	Jakub


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