Commit 62fc1d7d by Paolo Bonzini

re PR middle-end/17036 (ICE: (A >> N) & 1 ? (1 << N) : 0 where A of type unsigned int)

gcc/ChangeLog:
2004-08-17  Paolo Bonzini  <bonzini@gnu.org>

	PR middle-end/17036
	* fold-const.c (fold): Check for integer operand when
	folding (A >> N) & 1 ? (1 << N) : 0.  Fix from Andrew
	Pinski  <pinskia@physics.uc.edu>.

gcc/testsuite/ChangeLog:
2004-08-17  Paolo Bonzini  <bonzini@gnu.org>

	* gcc.dg/pr17036-1.c: New test.

From-SVN: r86112
parent 7c27e184
2004-08-17 Paolo Bonzini <bonzini@gnu.org>
PR middle-end/17036
* fold-const.c (fold): Check for integer operand when
folding (A >> N) & 1 ? (1 << N) : 0. Fix from Andrew
Pinski <pinskia@physics.uc.edu>.
2004-08-17 Paolo Bonzini <bonzini@gnu.org>
* configure.ac: Trust toplevel's notion of BISON/FLEX/MAKEINFO.
No need to check if in a cross configuration.
* configure: Regenerate.
......@@ -131,10 +138,9 @@
2004-08-16 Nathanael Nerode <neroden@gcc.gnu.org>
* tree-ssa-copyrename.c (copy_rename_partition_coalesce):
Check for arificial variables, not is_gimple_tmp_var.
Check for artificial variables, not is_gimple_tmp_var.
* tree-ssa-live.c (var_union): Likewise.
>>>>>>> 2.4930
2004-08-16 Nathan Sidwell <nathan@codesourcery.com>
* calls.c (load_register_parameters): Remove spurious FIXME token.
......
......@@ -8859,6 +8859,7 @@ fold (tree expr)
tree tem = TREE_OPERAND (arg0, 0);
STRIP_NOPS (tem);
if (TREE_CODE (tem) == RSHIFT_EXPR
&& TREE_CODE (TREE_OPERAND (tem, 1)) == INTEGER_CST
&& (unsigned HOST_WIDE_INT) tree_log2 (arg1) ==
TREE_INT_CST_LOW (TREE_OPERAND (tem, 1)))
return fold (build2 (BIT_AND_EXPR, type,
......
2004-08-17 Paolo Bonzini <bonzini@gnu.org>
* gcc.dg/pr17036-1.c: New test.
2004-08-16 Devang Patel <dpatel@apple.com>
* gcc.dg/darwin-20040809-1.c: New test.
......
/* { dg-do compile } */
int main ()
{
int R, N = 4;
unsigned int A = 2;
signed int B = 2;
((B >> N) & 1) ? 1 : 0;
((A >> N) & 1) ? 1 : 0;
return 0;
}
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