diff options
author | Jakub Jelinek <jakub@redhat.com> | 2015-02-13 15:42:30 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2015-02-13 15:42:30 +0100 |
commit | 730f474bf90d59582144b23c9176276ab680ef56 (patch) | |
tree | 057890be2e241d8ec94af725a0ddbbe26fa20fb6 /gcc | |
parent | 1e0c223f94b886b4d4e54582a1fb4ea9b5feb722 (diff) | |
download | gcc-730f474bf90d59582144b23c9176276ab680ef56.zip gcc-730f474bf90d59582144b23c9176276ab680ef56.tar.gz gcc-730f474bf90d59582144b23c9176276ab680ef56.tar.bz2 |
re PR ipa/65034 (ICE (segfault) on arm-linux-gnueabihf)
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/stmt.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ipa/pr65034.C | 40 |
6 files changed, 60 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa363dc..e06f69a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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 diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f181554..8132e2f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 810acd5..f95a61a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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; } @@ -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); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1aca0b5..5c9ff2e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..cb33d50 --- /dev/null +++ b/gcc/testsuite/g++.dg/ipa/pr65034.C @@ -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); + } +} |