re PR ipa/65034 (ICE (segfault) on arm-linux-gnueabihf)
authorJakub Jelinek <jakub@redhat.com>
Fri, 13 Feb 2015 14:42:30 +0000 (15:42 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 13 Feb 2015 14:42:30 +0000 (15:42 +0100)
PR ipa/65034
* stmt.c (emit_case_nodes): Use void_type_node instead of
NULL_TREE as LABEL_DECL type.

* decl.c (start_preparsed_function): Use void_type_node instead
of NULL_TREE as LABEL_DECL type.

* g++.dg/ipa/pr65034.C: New test.

From-SVN: r220683

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ipa/pr65034.C [new file with mode: 0644]

index fa363dc8bb984f974c7eabddb4f258f5edbf44f2..e06f69a74d2f01a5e1f7f882119d4d24b405700e 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR ipa/65034
+       * stmt.c (emit_case_nodes): Use void_type_node instead of
+       NULL_TREE as LABEL_DECL type.
+
 2015-02-13  John David Anglin  <danglin@gcc.gnu.org>
 
        * config/pa/constraints.md: Change "Q" and "T" constraints to memory
index f181554219a5b7548189f9d5e7658c8d3255b5a9..8132e2feee6d49dac21d934890c636bfcdc5c0e1 100644 (file)
@@ -1,3 +1,9 @@
+2015-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR ipa/65034
+       * decl.c (start_preparsed_function): Use void_type_node instead
+       of NULL_TREE as LABEL_DECL type.
+
 2015-02-12  Jason Merrill  <jason@redhat.com>
 
        PR c++/64898
index 810acd56e605177aa0c96eb9a6a35fa68e12b643..f95a61a4487a09c76074d02e98b71613c87e9353 100644 (file)
@@ -13721,7 +13721,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
          && targetm.cxx.cdtor_returns_this ()))
     {
       cdtor_label = build_decl (input_location, 
-                               LABEL_DECL, NULL_TREE, NULL_TREE);
+                               LABEL_DECL, NULL_TREE, void_type_node);
       DECL_CONTEXT (cdtor_label) = current_function_decl;
     }
 
index b85e3e605dd00025ad49a2a614df7d51f2686c00..45dc45fd049aed27d63ba8d47a00dd2858afafb3 100644 (file)
@@ -1722,7 +1722,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label,
 
              tree test_label
                = build_decl (curr_insn_location (),
-                             LABEL_DECL, NULL_TREE, NULL_TREE);
+                             LABEL_DECL, NULL_TREE, void_type_node);
 
               /* The default label could be reached either through the right
                  subtree or the left subtree. Divide the probability
@@ -1881,7 +1881,7 @@ emit_case_nodes (rtx index, case_node_ptr node, rtx default_label,
                 Branch to a label where we will handle it later.  */
 
              test_label = build_decl (curr_insn_location (),
-                                      LABEL_DECL, NULL_TREE, NULL_TREE);
+                                      LABEL_DECL, NULL_TREE, void_type_node);
               probability = conditional_probability (
                   node->right->subtree_prob + default_prob/2,
                   subtree_prob + default_prob);
index 1aca0b55a9247fdfc514b761595ea20fd46637af..5c9ff2e2f94e0073643855314047b0a7b1bd1a6f 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-13  Jakub Jelinek  <jakub@redhat.com>
+
+       PR ipa/65034
+       * g++.dg/ipa/pr65034.C: New test.
+
 2015-02-13  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        PR tree-optimization/65002
diff --git a/gcc/testsuite/g++.dg/ipa/pr65034.C b/gcc/testsuite/g++.dg/ipa/pr65034.C
new file mode 100644 (file)
index 0000000..cb33d50
--- /dev/null
@@ -0,0 +1,40 @@
+// PR ipa/65034
+// { dg-do compile }
+// { dg-options "-g -O2" }
+
+enum B { C };
+enum D { E };
+struct A { A (B, D) { } };
+struct F { unsigned g, h, i, j; } a;
+
+void
+foo (unsigned x, unsigned y)
+{
+  switch (x)
+    {
+    case 6:
+      a.i = y;
+      break;
+    case 7:
+      a.j = y;
+      break;
+    default:
+      A (C, E);
+    }
+}
+
+void
+bar (unsigned x, unsigned y)
+{
+  switch (x)
+    {
+    case 6:
+      a.i = y;
+      break;
+    case 7:
+      a.j = y;
+      break;
+    default:
+      A (C, E);
+    }
+}