projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f767bd6
)
(fold): Avoid exponential work when simplifying conditional
author
Richard Kenner
<kenner@gcc.gnu.org>
Sat, 9 Apr 1994 20:05:15 +0000
(16:05 -0400)
committer
Richard Kenner
<kenner@gcc.gnu.org>
Sat, 9 Apr 1994 20:05:15 +0000
(16:05 -0400)
expressions; don't recurse twice if ARG1 is constant.
From-SVN: r7010
gcc/fold-const.c
patch
|
blob
|
history
diff --git
a/gcc/fold-const.c
b/gcc/fold-const.c
index 81f7b4f03011b47581c2e37b5ab23ac12322fd48..b3e7e1f8f23c5b93d89ee64945ff15b8fcd9a014 100644
(file)
--- a/
gcc/fold-const.c
+++ b/
gcc/fold-const.c
@@
-3420,7
+3420,8
@@
fold (expr)
tree lhs = fold (build (code, type, true_value, arg1));
tree rhs = fold (build (code, type, false_value, arg1));
- if (TREE_CONSTANT (lhs) || TREE_CONSTANT (rhs))
+ if (TREE_CONSTANT (lhs) || TREE_CONSTANT (rhs)
+ || TREE_CONSTANT (arg1))
return fold (build (COND_EXPR, type, test, lhs, rhs));
arg1 = save_expr (arg1);