Commit a37a22da by Paolo Bonzini

implement-c.texi (Integers Implementation): Make GCC's promises about signed…

implement-c.texi (Integers Implementation): Make GCC's promises about signed left shift stronger and clarify the cases when...

2015-11-26  Paolo Bonzini <bonzini@gnu.org>

	* doc/implement-c.texi (Integers Implementation): Make GCC's promises
	about signed left shift stronger and clarify the cases when they're
	broken.

From-SVN: r230931
parent b3877860
2015-11-26 Paolo Bonzini <bonzini@gnu.org>
* doc/implement-c.texi (Integers Implementation): Make GCC's promises
about signed left shift stronger and clarify the cases when they're
broken.
2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2015-11-26 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Bernd Schmidt <bschmidt@redhat.com> Bernd Schmidt <bschmidt@redhat.com>
...@@ -7682,6 +7688,9 @@ ...@@ -7682,6 +7688,9 @@
* fold-const.c (fold_binary_loc) : Move (-A) * (-B) -> A * B * fold-const.c (fold_binary_loc) : Move (-A) * (-B) -> A * B
to match.pd. to match.pd.
* doc/implement-c.texi (Integers Implementation): Make GCC's promises
about signed left shift stronger and clarify the cases when they're
broken.
Move (a * (1 << b)) is (a << b) to match.pd. Move (a * (1 << b)) is (a << b) to match.pd.
Move convert (C1/X)*C2 into (C1*C2)/X to match.pd. Move convert (C1/X)*C2 into (C1*C2)/X to match.pd.
Move ~X & X, (X == 0) & X, and !X & X are zero to match.pd. Move ~X & X, (X == 0) & X, and !X & X are zero to match.pd.
...@@ -266,9 +266,11 @@ both the sign and value bits, where the sign bit is considered ...@@ -266,9 +266,11 @@ both the sign and value bits, where the sign bit is considered
immediately above the highest-value value bit. Signed @samp{>>} acts immediately above the highest-value value bit. Signed @samp{>>} acts
on negative numbers by sign extension. on negative numbers by sign extension.
GCC does not use the latitude given in C99 and C11 only to treat certain As an extension to the C language, GCC does not use the latitude given in
aspects of signed @samp{<<} as undefined, but this is subject to C99 and C11 only to treat certain aspects of signed @samp{<<} as undefined.
change. However, @option{-fsanitize=shift} (and @option{-fsanitize=undefined}) will
diagnose such cases. They are also diagnosed where constant
expressions are required.
@item @item
@cite{The sign of the remainder on integer division (C90 6.3.5).} @cite{The sign of the remainder on integer division (C90 6.3.5).}
......
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