re PR c++/83490 (ICE in find_call_stack_args, at dce.c:392)
authorJakub Jelinek <jakub@redhat.com>
Wed, 20 Dec 2017 09:12:09 +0000 (10:12 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 20 Dec 2017 09:12:09 +0000 (10:12 +0100)
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
gcc/calls.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/empty29.C [new file with mode: 0644]

index c90777035d0e1be9748b6106f09da063049045b1..9c22fd74637e055aa63b3ea014d5126a14e0ad18 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/83490
+       * calls.c (compute_argument_addresses): Ignore TYPE_EMPTY_P arguments.
+
 2017-12-20  Julia Koval  <julia.koval@intel.com>
 
        * common/config/i386/i386-common.c (OPTION_MASK_ISA_VPCLMULQDQ_SET,
index 6057aa65da0bef49cdb30470eafe25eb1e4f1122..166c152e19b2ca23728bc7ced095916e0b0ca50c 100644 (file)
@@ -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;
index 50bd37b31662e33ff42dd70dbe71fb9feca85c6e..41ec29e45920b44599dcf62ef75a8aa5c04e6c42 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-20  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/83490
+       * g++.dg/abi/empty29.C: New test.
+
 2017-12-20  Martin Liska  <mliska@suse.cz>
 
        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 (file)
index 0000000..92fa886
--- /dev/null
@@ -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 (); }