re PR c++/88636 (ICE: Segmentation fault (in c_tree_chain_next))
authorJakub Jelinek <jakub@redhat.com>
Thu, 3 Jan 2019 10:11:40 +0000 (11:11 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 3 Jan 2019 10:11:40 +0000 (11:11 +0100)
PR c++/88636
* decl.c (builtin_function_1): Return result of pushdecl_top_level
or pushdecl rather than decl.

* g++.target/i386/pr88636.C: New test.

From-SVN: r267548

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.target/i386/pr88636.C [new file with mode: 0644]

index 5b94654b10a80cfe9d3977f2c1837aa486e6033a..32576c58b84ec71bf4dd525edec42762c76f0e57 100644 (file)
@@ -1,3 +1,9 @@
+2019-01-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/88636
+       * decl.c (builtin_function_1): Return result of pushdecl_top_level
+       or pushdecl rather than decl.
+
 2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * tree.c (handle_nodiscard_attribute): Improve warning location.
index 2003008afc06b01e31fc81a7bc6188d4d253cc03..15bc4887a596849011c03f9cd98f147f5454a1d2 100644 (file)
@@ -4536,11 +4536,9 @@ builtin_function_1 (tree decl, tree context, bool is_global)
     }
 
   if (is_global)
-    pushdecl_top_level (decl);
+    return pushdecl_top_level (decl);
   else
-    pushdecl (decl);
-
-  return decl;
+    return pushdecl (decl);
 }
 
 tree
index c077f7a9a8e257f98a77dbc86bd64305b7d92003..413bb098b7c1b5b651ab976065ea9bd7cc0a9e19 100644 (file)
@@ -1,3 +1,8 @@
+2019-01-03  Jakub Jelinek  <jakub@redhat.com>
+
+       PR c++/88636
+       * g++.target/i386/pr88636.C: New test.
+
 2019-01-03  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * g++.dg/cpp1z/nodiscard3.C: Test locations too.
diff --git a/gcc/testsuite/g++.target/i386/pr88636.C b/gcc/testsuite/g++.target/i386/pr88636.C
new file mode 100644 (file)
index 0000000..fa4c132
--- /dev/null
@@ -0,0 +1,6 @@
+// PR c++/88636
+// { dg-do compile }
+// { dg-options "-msse2 -mno-sse3 -fno-exceptions --param ggc-min-heapsize=0" }
+
+extern unsigned int __builtin_ia32_crc32si (unsigned int, unsigned int);
+#pragma GCC target("sse4.2")