From: Jakub Jelinek Date: Mon, 26 Jan 2015 21:32:09 +0000 (+0100) Subject: re PR c/64778 (ICE on invalid code on x86_64-linux-gnu: tree check: expected class... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d38f7dcef3ac28aa0c405c651087938ea9d6939a;p=gcc.git 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 --- diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 33cc2bd3a20..f361e7cb77f 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2015-01-26 Jakub Jelinek + + 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 PR middle-end/64313 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index f39dfdd9aae..09b1bdf3893 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -3143,7 +3143,7 @@ convert_arguments (location_t loc, vec 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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64162b05604..26d82acbf2e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-26 Jakub Jelinek + + PR c/64778 + * gcc.dg/pr64778.c: New test. + 2015-01-26 Jakub Jelinek PR middle-end/64421 diff --git a/gcc/testsuite/gcc.dg/pr64778.c b/gcc/testsuite/gcc.dg/pr64778.c new file mode 100644 index 00000000000..71a2607e79c --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64778.c @@ -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; +}