Commit 65a07688 by Richard Kenner Committed by Richard Kenner

expr.c (store_field): Remove warning.

	* expr.c (store_field): Remove warning.
	(expand_expr, case COMPONENT_REF, case VIEW_CONVERT_EXPR): Likewise.
	(highest_pow2_factor, case MIN_EXPR, case MAX_EXPR): Add cases.
	(highest_pow2_factor, case *_DIV_EXPR): Only can do something if
	divisor constant power of 2.
	(highest_pow2_factor, case COMPOUND_EXPR): Look at operand 1.

From-SVN: r47753
parent f393dd70
Fri Dec 7 07:06:17 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* expr.c (store_field): Remove warning.
(expand_expr, case COMPONENT_REF, case VIEW_CONVERT_EXPR): Likewise.
(highest_pow2_factor, case MIN_EXPR, case MAX_EXPR): Add cases.
(highest_pow2_factor, case *_DIV_EXPR): Only can do something if
divisor constant power of 2.
(highest_pow2_factor, case COMPOUND_EXPR): Look at operand 1.
2001-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> 2001-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* alpha.c (function_arg): Cast value to HOST_WIDE_INT before * alpha.c (function_arg): Cast value to HOST_WIDE_INT before
......
...@@ -5043,7 +5043,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type, ...@@ -5043,7 +5043,7 @@ store_field (target, bitsize, bitpos, mode, exp, value_mode, unsignedp, type,
low-order bits. However, if EXP's type is a record and this is low-order bits. However, if EXP's type is a record and this is
big-endian machine, we want the upper BITSIZE bits. */ big-endian machine, we want the upper BITSIZE bits. */
if (BYTES_BIG_ENDIAN && GET_MODE_CLASS (GET_MODE (temp)) == MODE_INT if (BYTES_BIG_ENDIAN && GET_MODE_CLASS (GET_MODE (temp)) == MODE_INT
&& bitsize < GET_MODE_BITSIZE (GET_MODE (temp)) && bitsize < (HOST_WIDE_INT) GET_MODE_BITSIZE (GET_MODE (temp))
&& TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE) && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE)
temp = expand_shift (RSHIFT_EXPR, GET_MODE (temp), temp, temp = expand_shift (RSHIFT_EXPR, GET_MODE (temp), temp,
size_int (GET_MODE_BITSIZE (GET_MODE (temp)) size_int (GET_MODE_BITSIZE (GET_MODE (temp))
...@@ -5790,7 +5790,7 @@ highest_pow2_factor (exp) ...@@ -5790,7 +5790,7 @@ highest_pow2_factor (exp)
} }
break; break;
case PLUS_EXPR: case MINUS_EXPR: case PLUS_EXPR: case MINUS_EXPR: case MIN_EXPR: case MAX_EXPR:
c0 = highest_pow2_factor (TREE_OPERAND (exp, 0)); c0 = highest_pow2_factor (TREE_OPERAND (exp, 0));
c1 = highest_pow2_factor (TREE_OPERAND (exp, 1)); c1 = highest_pow2_factor (TREE_OPERAND (exp, 1));
return MIN (c0, c1); return MIN (c0, c1);
...@@ -5802,14 +5802,22 @@ highest_pow2_factor (exp) ...@@ -5802,14 +5802,22 @@ highest_pow2_factor (exp)
case ROUND_DIV_EXPR: case TRUNC_DIV_EXPR: case FLOOR_DIV_EXPR: case ROUND_DIV_EXPR: case TRUNC_DIV_EXPR: case FLOOR_DIV_EXPR:
case CEIL_DIV_EXPR: case CEIL_DIV_EXPR:
if (integer_pow2p (TREE_OPERAND (exp, 1))
&& host_integerp (TREE_OPERAND (exp, 1), 1))
{
c0 = highest_pow2_factor (TREE_OPERAND (exp, 0)); c0 = highest_pow2_factor (TREE_OPERAND (exp, 0));
c1 = highest_pow2_factor (TREE_OPERAND (exp, 1)); c1 = tree_low_cst (TREE_OPERAND (exp, 1), 1);
return MAX (1, c0 / c1); return MAX (1, c0 / c1);
}
break;
case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR: case NON_LVALUE_EXPR: case NOP_EXPR: case CONVERT_EXPR:
case COMPOUND_EXPR: case SAVE_EXPR: case WITH_RECORD_EXPR: case SAVE_EXPR: case WITH_RECORD_EXPR:
return highest_pow2_factor (TREE_OPERAND (exp, 0)); return highest_pow2_factor (TREE_OPERAND (exp, 0));
case COMPOUND_EXPR:
return highest_pow2_factor (TREE_OPERAND (exp, 1));
case COND_EXPR: case COND_EXPR:
c0 = highest_pow2_factor (TREE_OPERAND (exp, 1)); c0 = highest_pow2_factor (TREE_OPERAND (exp, 1));
c1 = highest_pow2_factor (TREE_OPERAND (exp, 2)); c1 = highest_pow2_factor (TREE_OPERAND (exp, 2));
...@@ -6932,7 +6940,7 @@ expand_expr (exp, target, tmode, modifier) ...@@ -6932,7 +6940,7 @@ expand_expr (exp, target, tmode, modifier)
machine, we must put the field into the high-order bits. */ machine, we must put the field into the high-order bits. */
if (TREE_CODE (type) == RECORD_TYPE && BYTES_BIG_ENDIAN if (TREE_CODE (type) == RECORD_TYPE && BYTES_BIG_ENDIAN
&& GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT
&& bitsize < GET_MODE_BITSIZE (GET_MODE (op0))) && bitsize < (HOST_WIDE_INT) GET_MODE_BITSIZE (GET_MODE (op0)))
op0 = expand_shift (LSHIFT_EXPR, GET_MODE (op0), op0, op0 = expand_shift (LSHIFT_EXPR, GET_MODE (op0), op0,
size_int (GET_MODE_BITSIZE (GET_MODE (op0)) size_int (GET_MODE_BITSIZE (GET_MODE (op0))
- bitsize), - bitsize),
...@@ -7305,8 +7313,9 @@ expand_expr (exp, target, tmode, modifier) ...@@ -7305,8 +7313,9 @@ expand_expr (exp, target, tmode, modifier)
&& MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (TYPE_MODE (type))) && MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (TYPE_MODE (type)))
{ {
tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0)); tree inner_type = TREE_TYPE (TREE_OPERAND (exp, 0));
HOST_WIDE_INT temp_size = MAX (int_size_in_bytes (inner_type), HOST_WIDE_INT temp_size
GET_MODE_SIZE (TYPE_MODE (type))); = MAX (int_size_in_bytes (inner_type),
(HOST_WIDE_INT) GET_MODE_SIZE (TYPE_MODE (type)));
rtx new = assign_stack_temp_for_type (TYPE_MODE (type), rtx new = assign_stack_temp_for_type (TYPE_MODE (type),
temp_size, 0, type); temp_size, 0, type);
rtx new_with_op0_mode = copy_rtx (new); rtx new_with_op0_mode = copy_rtx (new);
......
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