This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C PATCH] Fix C error-recovery (PR c/69796, PR c/69974)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, Marek Polacek <polacek at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Feb 2016 23:17:42 +0100
- Subject: Re: [C PATCH] Fix C error-recovery (PR c/69796, PR c/69974)
- Authentication-results: sourceware.org; auth=none
- References: <20160226144336 dot GC3017 at tucnak dot redhat dot com> <56D0C782 dot 4000904 at redhat dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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