aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-07-18 20:45:18 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-07-18 20:45:18 +0200
commite43ebb1268899ccce28383a361b947493a4f452c (patch)
tree9c08fdd4524a478dac68dbb39ddefd1af7ae54df /gcc
parent99516432c26d13ba2808daf860253b4f945336d9 (diff)
downloadgcc-e43ebb1268899ccce28383a361b947493a4f452c.zip
gcc-e43ebb1268899ccce28383a361b947493a4f452c.tar.gz
gcc-e43ebb1268899ccce28383a361b947493a4f452c.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): Revert the 2016-07-07 change. * tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and DECL_SIZE_UNIT. From-SVN: r238444
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-gimplify.c10
-rw-r--r--gcc/cp/tree.c16
3 files changed, 24 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9fa2f3a..c88b98c 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
2016-07-18 Jakub Jelinek <jakub@redhat.com>
+ PR c++/70869
+ PR c++/71054
+ * cp-gimplify.c (cp_genericize_r): Revert the 2016-07-07 change.
+ * tree.c (cp_walk_subtrees): For DECL_EXPR on DECL_ARTIFICIAL
+ non-static VAR_DECL, walk the decl's DECL_INITIAL, DECL_SIZE and
+ DECL_SIZE_UNIT.
+
PR c++/71835
* call.c (build_op_call_1): Use convert_like_with_context only
if cand->fn is a decl.
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index de6c929..41ab35f 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1351,15 +1351,7 @@ 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));
- /* 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);
- }
+ gcc_assert (CP_DECL_THREAD_LOCAL_P (d) == DECL_THREAD_LOCAL_P (d));
}
else if (TREE_CODE (stmt) == OMP_PARALLEL
|| TREE_CODE (stmt) == OMP_TASK
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 4cbf621..faf096c 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -4075,6 +4075,22 @@ cp_walk_subtrees (tree *tp, int *walk_subtrees_p, walk_tree_fn func,
*walk_subtrees_p = 0;
break;
+ case DECL_EXPR:
+ /* User variables should be mentioned in BIND_EXPR_VARS
+ and their initializers and sizes walked when walking
+ the containing BIND_EXPR. Compiler temporaries are
+ handled here. */
+ if (VAR_P (TREE_OPERAND (*tp, 0))
+ && DECL_ARTIFICIAL (TREE_OPERAND (*tp, 0))
+ && !TREE_STATIC (TREE_OPERAND (*tp, 0)))
+ {
+ tree decl = TREE_OPERAND (*tp, 0);
+ WALK_SUBTREE (DECL_INITIAL (decl));
+ WALK_SUBTREE (DECL_SIZE (decl));
+ WALK_SUBTREE (DECL_SIZE_UNIT (decl));
+ }
+ break;
+
default:
return NULL_TREE;
}