Commit 7d46d516 by Toon Moene Committed by Toon Moene

tree.def: Document restriction on {L|R}SHIFT_EXPR's second argument.

2001-07-19  Toon Moene  <toon@moene.indiv.nluug.nl>

	* tree.def: Document restriction on {L|R}SHIFT_EXPR's second argument.
	* doc/tree.texi: Ditto.
	* f/com.c (ffecom_expr_intrinsic_): Cope with it.

From-SVN: r44156
parent 5442cf15
2001-07-19 Toon Moene <toon@moene.indiv.nluug.nl>
* tree.def: Document restriction on {L|R}SHIFT_EXPR's second argument.
* doc/tree.texi: Ditto.
2001-07-19 Mark Kettenis <kettenis@wins.uva.nl> 2001-07-19 Mark Kettenis <kettenis@wins.uva.nl>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -2003,6 +2003,9 @@ second operand is an expression for the number of bits by which to ...@@ -2003,6 +2003,9 @@ second operand is an expression for the number of bits by which to
shift. Right shift should be treated as arithmetic, i.e., the shift. Right shift should be treated as arithmetic, i.e., the
high-order bits should be zero-filled when the expression has unsigned high-order bits should be zero-filled when the expression has unsigned
type and filled with the sign bit when the expression has signed type. type and filled with the sign bit when the expression has signed type.
Note that the result is undefined if the second operand is larger
than the first operand's type size.
@item BIT_IOR_EXPR @item BIT_IOR_EXPR
@itemx BIT_XOR_EXPR @itemx BIT_XOR_EXPR
......
2001-07-19 Toon Moene <toon@moene.indiv.nluug.nl>
* f/com.c (ffecom_expr_intrinsic_): Deal (correctly) with
{L|R}SHIFT_EXPR not working when shift > size of type.
2001-07-17 Toon Moene <toon@moene.indiv.nluug.nl> 2001-07-17 Toon Moene <toon@moene.indiv.nluug.nl>
* com.c (lang_print_error_function): Argument context * com.c (lang_print_error_function): Argument context
......
...@@ -4573,8 +4573,10 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree, ...@@ -4573,8 +4573,10 @@ ffecom_expr_intrinsic_ (ffebld expr, tree dest_tree,
expr_tree expr_tree
= ffecom_3 (COND_EXPR, tree_type, = ffecom_3 (COND_EXPR, tree_type,
ffecom_truth_value ffecom_truth_value
(ffecom_2 (NE_EXPR, integer_type_node, (ffecom_2 (LT_EXPR, integer_type_node,
arg2_tree, ffecom_1 (ABS_EXPR,
integer_type_node,
arg2_tree),
TYPE_SIZE (uns_type))), TYPE_SIZE (uns_type))),
expr_tree, expr_tree,
convert (tree_type, integer_zero_node)); convert (tree_type, integer_zero_node));
......
...@@ -617,7 +617,9 @@ DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1) ...@@ -617,7 +617,9 @@ DEFTREECODE (FFS_EXPR, "ffs_expr", '1', 1)
Shift means logical shift if done on an Shift means logical shift if done on an
unsigned type, arithmetic shift if done on a signed type. unsigned type, arithmetic shift if done on a signed type.
The second operand is the number of bits to The second operand is the number of bits to
shift by; it need not be the same type as the first operand and result. */ shift by; it need not be the same type as the first operand and result.
Note that the result is undefined if the second operand is larger
than the first operand's type size. */
DEFTREECODE (LSHIFT_EXPR, "lshift_expr", '2', 2) DEFTREECODE (LSHIFT_EXPR, "lshift_expr", '2', 2)
DEFTREECODE (RSHIFT_EXPR, "rshift_expr", '2', 2) DEFTREECODE (RSHIFT_EXPR, "rshift_expr", '2', 2)
DEFTREECODE (LROTATE_EXPR, "lrotate_expr", '2', 2) DEFTREECODE (LROTATE_EXPR, "lrotate_expr", '2', 2)
......
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