Commit d434a42c by Richard Stallman

(convert_to_integer): When optimizing LSHIFT_EXPR and

RSHIFT_EXPR, do compares at tree level.

From-SVN: r2086
parent 24f8db99
...@@ -177,20 +177,20 @@ convert_to_integer (type, expr) ...@@ -177,20 +177,20 @@ convert_to_integer (type, expr)
{ {
case RSHIFT_EXPR: case RSHIFT_EXPR:
/* We can pass truncation down through right shifting /* We can pass truncation down through right shifting
when the shift count is a negative constant. */ when the shift count is a nonpositive constant. */
if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST
|| TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) > 0) && tree_int_cst_lt (TREE_OPERAND (expr, 1), integer_one_node))
break; goto trunc1;
goto trunc1; break;
case LSHIFT_EXPR: case LSHIFT_EXPR:
/* We can pass truncation down through left shifting /* We can pass truncation down through left shifting
when the shift count is a positive constant. */ when the shift count is a nonnegative constant. */
if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST
|| TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) < 0) && ! tree_int_cst_lt (TREE_OPERAND (expr, 1), integer_zero_node))
break; /* In this case, shifting is like multiplication. */
/* In this case, shifting is like multiplication. */ goto trunc1;
goto trunc1; break;
case MAX_EXPR: case MAX_EXPR:
case MIN_EXPR: case MIN_EXPR:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment