aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2017-02-03 17:42:37 -0500
committerJason Merrill <jason@gcc.gnu.org>2017-02-03 17:42:37 -0500
commit77095a6ab13996a38b0a360d8ef9fc6cc6bc5234 (patch)
tree3d5b23c76bf199ee7e8f14bc642997ba0d96ab88 /gcc/tree-inline.c
parentac6dbb1a4042eaa719afbb9c7a02e4f409b8aa75 (diff)
downloadgcc-77095a6ab13996a38b0a360d8ef9fc6cc6bc5234.zip
gcc-77095a6ab13996a38b0a360d8ef9fc6cc6bc5234.tar.gz
gcc-77095a6ab13996a38b0a360d8ef9fc6cc6bc5234.tar.bz2
PR c++/78689 - ICE on constructor with label
gcc/ * tree-inline.c (copy_tree_body_r) [COND_EXPR]: Revert change to avoid copying non-taken branch. gcc/cp/ * optimize.c (maybe_clone_body): Replace omitted parameters with null lvalues. * class.c (build_clone): Fix logic for omitting inherited parms. From-SVN: r245172
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c33
1 files changed, 1 insertions, 32 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index d63c70f..138b992 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -1045,7 +1045,6 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
copy_body_data *id = (copy_body_data *) data;
tree fn = id->src_fn;
tree new_block;
- bool copied = false;
/* Begin by recognizing trees that we'll completely rewrite for the
inlining context. Our output for these trees is completely
@@ -1242,40 +1241,10 @@ copy_tree_body_r (tree *tp, int *walk_subtrees, void *data)
*walk_subtrees = 0;
return NULL;
}
- else if (TREE_CODE (*tp) == COND_EXPR)
- {
- tree cond = TREE_OPERAND (*tp, 0);
- walk_tree (&cond, copy_tree_body_r, data, NULL);
- tree folded = fold (cond);
- if (TREE_CODE (folded) == INTEGER_CST)
- {
- /* Only copy the taken branch; for a C++ base constructor clone
- inherited from a virtual base, copying the other branch leads
- to references to parameters that were optimized away. */
- tree branch = (integer_nonzerop (folded)
- ? TREE_OPERAND (*tp, 1)
- : TREE_OPERAND (*tp, 2));
- tree type = TREE_TYPE (*tp);
- if (VOID_TYPE_P (type)
- || type == TREE_TYPE (branch))
- {
- *tp = branch;
- return copy_tree_body_r (tp, walk_subtrees, data);
- }
- }
- /* Avoid copying the condition twice. */
- copy_tree_r (tp, walk_subtrees, NULL);
- TREE_OPERAND (*tp, 0) = cond;
- walk_tree (&TREE_OPERAND (*tp, 1), copy_tree_body_r, data, NULL);
- walk_tree (&TREE_OPERAND (*tp, 2), copy_tree_body_r, data, NULL);
- *walk_subtrees = 0;
- copied = true;
- }
/* Here is the "usual case". Copy this tree node, and then
tweak some special cases. */
- if (!copied)
- copy_tree_r (tp, walk_subtrees, NULL);
+ copy_tree_r (tp, walk_subtrees, NULL);
/* If EXPR has block defined, map it to newly constructed block.
When inlining we want EXPRs without block appear in the block