From 1570e19df497e00a8565e53445961bf25db79725 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Tue, 19 Dec 2017 14:58:17 +0000 Subject: [PATCH] re PR c++/83490 (ICE in find_call_stack_args, at dce.c:392) PR c++/83490 * config/i386/i386.c (init_cumulative_args): Don't check TYPE_EMPTY_P on an error node. * g++.dg/abi/pr83490.C: New test. From-SVN: r255824 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 2 +- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/abi/pr83490.C | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/abi/pr83490.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6af469c856..05e2a158fba 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-12-19 Marek Polacek + + PR c++/83490 + * config/i386/i386.c (init_cumulative_args): Don't check TYPE_EMPTY_P + on an error node. + 2017-12-19 Claudiu Zissulescu * config/arc/arc.c (overriderregs): New variable. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b9f6e27f9b1..82a79bdb426 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -7218,7 +7218,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, /* Argument info to initialize */ bool seen_empty_type = false; FOREACH_FUNCTION_ARGS (fntype, argtype, iter) { - if (VOID_TYPE_P (argtype)) + if (argtype == error_mark_node || VOID_TYPE_P (argtype)) break; if (TYPE_EMPTY_P (argtype)) seen_empty_type = true; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9849fbaa8af..dd51941daec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-19 Marek Polacek + + PR c++/83490 + * g++.dg/abi/pr83490.C: New test. + 2017-12-19 H.J. Lu PR middle-end/83471 diff --git a/gcc/testsuite/g++.dg/abi/pr83490.C b/gcc/testsuite/g++.dg/abi/pr83490.C new file mode 100644 index 00000000000..850c4c0fd9e --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/pr83490.C @@ -0,0 +1,17 @@ +// PR c++/83490 +// { dg-options "-Wabi" } + +struct A +{ + A foo(void i = 0); // { dg-error "incomplete type|invalid use" } +}; + +void bar() +{ + A().foo(); +} + +A A::foo(void i) // { dg-error "incomplete type|invalid use" } +{ + return A(); +} -- 2.30.2