diff options
author | robc <robc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-08 13:52:42 +0000 |
---|---|---|
committer | robc <robc@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-08 13:52:42 +0000 |
commit | ec0fa5135c41c01378cd977c6c0dd620b8a940fd (patch) | |
tree | dcb7083fc910095eb2aebe069e3d37af32897742 /gcc/tree-ssa-ccp.c | |
parent | 24838d3fed690e66437b90c4ff5944976dcfee6d (diff) | |
download | gcc-ec0fa5135c41c01378cd977c6c0dd620b8a940fd.tar.gz |
Better handling of COND_EXPRs in rhs
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120581 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-ccp.c')
-rw-r--r-- | gcc/tree-ssa-ccp.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c index 493bdecedcd..0f02b8c8651 100644 --- a/gcc/tree-ssa-ccp.c +++ b/gcc/tree-ssa-ccp.c @@ -2109,6 +2109,10 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type) if (TREE_CODE (arg) != SSA_NAME) { + if (TREE_CODE (arg) == COND_EXPR) + return get_maxval_strlen (COND_EXPR_THEN (arg), length, visited, type) + && get_maxval_strlen (COND_EXPR_ELSE (arg), length, visited, type); + if (type == 2) { val = arg; @@ -2438,6 +2442,13 @@ fold_stmt (tree *stmt_p) } } } + else if (TREE_CODE (rhs) == COND_EXPR) + { + tree temp = fold (COND_EXPR_COND (rhs)); + if (temp != COND_EXPR_COND (rhs)) + result = fold_build3 (COND_EXPR, TREE_TYPE (rhs), temp, + COND_EXPR_THEN (rhs), COND_EXPR_ELSE (rhs)); + } /* If we couldn't fold the RHS, hand over to the generic fold routines. */ if (result == NULL_TREE) |