This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix documentation of LSHIFT_EXPR and RSHIFT_EXPR


This patch follows up on Toon's patch from here:
<http://gcc.gnu.org/ml/gcc-patches/2001-07/msg01310.html>, namely it documents
that LSHIFT_EXPR and RSHIFT_EXPR are not defined for shift width >= the types
bit size. Currently, the documentation says > instead of >= (and the Fortran
FE gets it wrong again, but I have a fix for this in the works).

I assume that this is obvious given the previous exchange on this subject, but
since this is the first time that I touch non-Fortran parts of the compiler,
I'm asking for approval anyway.

Thanks,
- Tobi

2004-12-14  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>

	* tree.def, doc/c-tree.texi: Correctly document restrictions on the
	shift width.

Index: tree.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.def,v
retrieving revision 1.106
diff -u -p -r1.106 tree.def
--- tree.def    9 Dec 2004 11:06:17 -0000       1.106
+++ tree.def    14 Dec 2004 16:49:40 -0000
@@ -630,7 +630,7 @@ DEFTREECODE (ABS_EXPR, "abs_expr", tcc_u
    The second operand is the number of bits to
    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.  */
+   than or equal to the first operand's type size.  */
 DEFTREECODE (LSHIFT_EXPR, "lshift_expr", tcc_binary, 2)
 DEFTREECODE (RSHIFT_EXPR, "rshift_expr", tcc_binary, 2)
 DEFTREECODE (LROTATE_EXPR, "lrotate_expr", tcc_binary, 2)
Index: doc/c-tree.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/c-tree.texi,v
retrieving revision 1.67
diff -u -p -r1.67 c-tree.texi
--- doc/c-tree.texi     5 Nov 2004 01:36:55 -0000       1.67
+++ doc/c-tree.texi     14 Dec 2004 16:49:40 -0000
@@ -2011,7 +2011,7 @@ shift.  Right shift should be treated as
 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.
 Note that the result is undefined if the second operand is larger
-than the first operand's type size.
+than or equal to the first operand's type size.


 @item BIT_IOR_EXPR



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]