]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/83490 (ICE in find_call_stack_args, at dce.c:392)
authorMarek Polacek <polacek@redhat.com>
Tue, 19 Dec 2017 14:58:17 +0000 (14:58 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 19 Dec 2017 14:58:17 +0000 (14:58 +0000)
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
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/abi/pr83490.C [new file with mode: 0644]

index f6af469c8562e840d40321ca34d4be4cb0617f4a..05e2a158fba801428413edc35925d07a9f4e60b4 100644 (file)
@@ -1,3 +1,9 @@
+2017-12-19  Marek Polacek  <polacek@redhat.com>
+
+       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  <claziss@synopsys.com>
 
        * config/arc/arc.c (overriderregs): New variable.
index b9f6e27f9b1376303d0b7d77c694e77d269afd06..82a79bdb4264117e92f4b983d44f30d95226c3b2 100644 (file)
@@ -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;
index 9849fbaa8afdc748843de178ea76387e7e2dc03b..dd51941daecb1ed74ea25cf1b9b62827ded0818c 100644 (file)
@@ -1,3 +1,8 @@
+2017-12-19  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/83490
+       * g++.dg/abi/pr83490.C: New test.
+
 2017-12-19  H.J. Lu  <hongjiu.lu@intel.com>
 
        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 (file)
index 0000000..850c4c0
--- /dev/null
@@ -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();
+}