From 5b8b4a883d74dc74ecf64643e7d3a060db489318 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 20 Dec 2017 10:12:09 +0100 Subject: [PATCH] re PR c++/83490 (ICE in find_call_stack_args, at dce.c:392) PR c++/83490 * calls.c (compute_argument_addresses): Ignore TYPE_EMPTY_P arguments. * g++.dg/abi/empty29.C: New test. From-SVN: r255852 --- gcc/ChangeLog | 5 +++++ gcc/calls.c | 3 +++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/abi/empty29.C | 7 +++++++ 4 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/abi/empty29.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c90777035d0..9c22fd74637 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-12-20 Jakub Jelinek + + PR c++/83490 + * calls.c (compute_argument_addresses): Ignore TYPE_EMPTY_P arguments. + 2017-12-20 Julia Koval * common/config/i386/i386-common.c (OPTION_MASK_ISA_VPCLMULQDQ_SET, diff --git a/gcc/calls.c b/gcc/calls.c index 6057aa65da0..166c152e19b 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2365,6 +2365,9 @@ compute_argument_addresses (struct arg_data *args, rtx argblock, int num_actuals && args[i].partial == 0) continue; + if (TYPE_EMPTY_P (TREE_TYPE (args[i].tree_value))) + continue; + /* Pointer Bounds are never passed on the stack. */ if (POINTER_BOUNDS_P (args[i].tree_value)) continue; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 50bd37b3166..41ec29e4592 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-12-20 Jakub Jelinek + + PR c++/83490 + * g++.dg/abi/empty29.C: New test. + 2017-12-20 Martin Liska PR middle-end/82404 diff --git a/gcc/testsuite/g++.dg/abi/empty29.C b/gcc/testsuite/g++.dg/abi/empty29.C new file mode 100644 index 00000000000..92fa88674e8 --- /dev/null +++ b/gcc/testsuite/g++.dg/abi/empty29.C @@ -0,0 +1,7 @@ +// PR c++/83490 +// { dg-do compile { target i?86-*-* x86_64-*-* } } +// { dg-options "-fipa-icf-functions -Og -maccumulate-outgoing-args" } + +struct A {}; +A operator < (A, A) { return A (); } +A operator > (A, A) { return A (); } -- 2.30.2