aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2003-12-19 14:39:05 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2003-12-19 14:39:05 +0100
commiteffed6551681c1411cfaebeb005979cb6996e528 (patch)
tree6bb121a9a36677cc5cb47841903d0d894ded6ae6 /gcc/builtins.c
parentc05fc0c2e1dc82c3e8c53a8d492bd7e0578868ec (diff)
downloadgcc-effed6551681c1411cfaebeb005979cb6996e528.zip
gcc-effed6551681c1411cfaebeb005979cb6996e528.tar.gz
gcc-effed6551681c1411cfaebeb005979cb6996e528.tar.bz2
re PR c++/13239 (Assertion does not seem to work correctly anymore)
PR c++/13239 * builtins.c (expand_builtin_expect_jump): Update TREE_VALUE (arglist) if unsave_expr_now langhook created a new tree. * g++.dg/opt/expect1.C: New test. From-SVN: r74832
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index ba62446..d3dfb88 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -4460,6 +4460,14 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label)
ret = get_insns ();
end_sequence ();
+ /* For mildly unsafe builtin jump's, if unsave_expr_now
+ creates a new tree instead of changing the old one
+ TREE_VALUE (arglist) needs to be updated. */
+ if (arg0 != TREE_VALUE (arglist)
+ && TREE_CODE (arg0) == UNSAVE_EXPR
+ && TREE_OPERAND (arg0, 0) != TREE_VALUE (arglist))
+ TREE_VALUE (arglist) = TREE_OPERAND (arg0, 0);
+
/* Now that the __builtin_expect has been validated, go through and add
the expect's to each of the conditional jumps. If we run into an
error, just give up and generate the 'safe' code of doing a SCC