aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-07-07 20:45:43 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-07-07 20:45:43 +0200
commit842dc2e6ed6e6095032eb5af7037e3b5718d3336 (patch)
tree2921d133aa939d48c09f7060d04886a291f93d59 /gcc/cp
parent31be42626d491e317b261aa64744a0e1346a1f1b (diff)
downloadgcc-842dc2e6ed6e6095032eb5af7037e3b5718d3336.zip
gcc-842dc2e6ed6e6095032eb5af7037e3b5718d3336.tar.gz
gcc-842dc2e6ed6e6095032eb5af7037e3b5718d3336.tar.bz2
re PR c++/70869 (internal compiler error: Segmentation fault on array of pointer to function members)
PR c++/70869 PR c++/71054 * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static artificial vars, genericize their initializers. * g++.dg/cpp0x/pr70869.C: New test. * g++.dg/cpp0x/pr71054.C: New test. Co-Authored-By: Kai Tietz <ktietz70@googlemail.com> From-SVN: r238124
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/cp-gimplify.c10
2 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c129b5f..12f15db 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2016-07-07 Jakub Jelinek <jakub@redhat.com>
+ Kai Tietz <ktietz70@googlemail.com>
+
+ PR c++/70869
+ PR c++/71054
+ * cp-gimplify.c (cp_genericize_r): For DECL_EXPR for non-static
+ artificial vars, genericize their initializers.
+
2016-07-05 David Malcolm <dmalcolm@redhat.com>
PR c++/62314
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 97b043a..1d81fb1 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1304,7 +1304,15 @@ cp_genericize_r (tree *stmt_p, int *walk_subtrees, void *data)
{
tree d = DECL_EXPR_DECL (stmt);
if (TREE_CODE (d) == VAR_DECL)
- gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
+ {
+ gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
+ /* User var initializers should be genericized during containing
+ BIND_EXPR genericization when walk_tree walks DECL_INITIAL
+ of BIND_EXPR_VARS. Artificial temporaries might not be
+ mentioned there though, so walk them now. */
+ if (DECL_ARTIFICIAL (d) && !TREE_STATIC (d) && DECL_INITIAL (d))
+ cp_walk_tree (&DECL_INITIAL (d), cp_genericize_r, data, NULL);
+ }
}
else if (TREE_CODE (stmt) == OMP_PARALLEL
|| TREE_CODE (stmt) == OMP_TASK