gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under GIMPLE_ASSIGN.
2012-05-16 Andrew Pinski <apinski@cavium.com> * gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under GIMPLE_ASSIGN. From-SVN: r187608
This commit is contained in:
parent
0e2b0f75cc
commit
763dc99dd3
2 changed files with 15 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-05-16 Andrew Pinski <apinski@cavium.com>
|
||||
|
||||
* gimple-fold.c (get_maxval_strlen): Move COND_EXPR handling under
|
||||
GIMPLE_ASSIGN.
|
||||
|
||||
2012-05-16 David S. Miller <davem@davemloft.net>
|
||||
|
||||
* jump.c (delete_related_insns): If we remove a CALL, make sure
|
||||
|
|
|
@ -670,13 +670,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);
|
||||
/* We can end up with &(*iftmp_1)[0] here as well, so handle it. */
|
||||
else if (TREE_CODE (arg) == ADDR_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF
|
||||
&& integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1)))
|
||||
if (TREE_CODE (arg) == ADDR_EXPR
|
||||
&& TREE_CODE (TREE_OPERAND (arg, 0)) == ARRAY_REF
|
||||
&& integer_zerop (TREE_OPERAND (TREE_OPERAND (arg, 0), 1)))
|
||||
{
|
||||
tree aop0 = TREE_OPERAND (TREE_OPERAND (arg, 0), 0);
|
||||
if (TREE_CODE (aop0) == INDIRECT_REF
|
||||
|
@ -736,6 +733,13 @@ get_maxval_strlen (tree arg, tree *length, bitmap visited, int type)
|
|||
tree rhs = gimple_assign_rhs1 (def_stmt);
|
||||
return get_maxval_strlen (rhs, length, visited, type);
|
||||
}
|
||||
else if (gimple_assign_rhs_code (def_stmt) == COND_EXPR)
|
||||
{
|
||||
tree op2 = gimple_assign_rhs2 (def_stmt);
|
||||
tree op3 = gimple_assign_rhs3 (def_stmt);
|
||||
return get_maxval_strlen (op2, length, visited, type)
|
||||
&& get_maxval_strlen (op3, length, visited, type);
|
||||
}
|
||||
return false;
|
||||
|
||||
case GIMPLE_PHI:
|
||||
|
|
Loading…
Add table
Reference in a new issue