re PR c/64778 (ICE on invalid code on x86_64-linux-gnu: tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in create_tmp_from_val, at gimplify.c:491)

PR c/64778
	* c-typeck.c (convert_arguments): Return -1 if there are
	error_args, even if we've diagnosed too many arguments.

	* gcc.dg/pr64778.c: New test.

From-SVN: r220138
This commit is contained in:
Jakub Jelinek 2015-01-26 22:32:09 +01:00 committed by Jakub Jelinek
parent 4cd76837a8
commit d38f7dcef3
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2015-01-26 Jakub Jelinek <jakub@redhat.com>
PR c/64778
* c-typeck.c (convert_arguments): Return -1 if there are
error_args, even if we've diagnosed too many arguments.
2015-01-21 Richard Biener <rguenther@suse.de>
PR middle-end/64313

View File

@ -3143,7 +3143,7 @@ convert_arguments (location_t loc, vec<location_t> arg_loc, tree typelist,
else
error_at (loc, "too many arguments to function %qE", function);
inform_declaration (fundecl);
return parmnum;
return error_args ? -1 : (int) parmnum;
}
if (selector && argnum > 2)

View File

@ -1,3 +1,8 @@
2015-01-26 Jakub Jelinek <jakub@redhat.com>
PR c/64778
* gcc.dg/pr64778.c: New test.
2015-01-26 Jakub Jelinek <jakub@redhat.com>
PR middle-end/64421

View File

@ -0,0 +1,10 @@
/* PR c/64778 */
/* { dg-do compile } */
int
foo (int p)
{
int a;
a ^= foo (,); /* { dg-error "expected expression before|too many arguments" } */
return a;
}