From d38f7dcef3ac28aa0c405c651087938ea9d6939a Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 26 Jan 2015 22:32:09 +0100 Subject: [PATCH] =?utf8?q?re=20PR=20c/64778=20(ICE=20on=20invalid=20code?= =?utf8?q?=20on=20x86=5F64-linux-gnu:=20tree=20check:=20expected=20class?= =?utf8?q?=20=E2=80=98type=E2=80=99,=20have=20=E2=80=98exceptional?= =?utf8?q?=E2=80=99=20(error=5Fmark)=20in=20create=5Ftmp=5Ffrom=5Fval,=20a?= =?utf8?q?t=20gimplify.c:491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- gcc/c/ChangeLog | 6 ++++++ gcc/c/c-typeck.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr64778.c | 10 ++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/pr64778.c 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; +} -- 2.30.2