Commit 3d62b895 by Richard Guenther Committed by Richard Biener

re PR middle-end/40252 (Internal compiler error on samba4 (verify_gimple failed))

2009-05-26  Richard Guenther  <rguenther@suse.de>

	PR middle-end/40252
	* fold-const.c (fold_binary): Use the correct types for building
	rotates.

	* gcc.c-torture/compile/pr40252.c: New testcase.

From-SVN: r147867
parent 2eb25c98
2009-05-26 Richard Guenther <rguenther@suse.de> 2009-05-26 Richard Guenther <rguenther@suse.de>
PR middle-end/40252
* fold-const.c (fold_binary): Use the correct types for building
rotates.
2009-05-26 Richard Guenther <rguenther@suse.de>
* tree-vect-data-refs.c (vect_create_data_ref_ptr): Remove * tree-vect-data-refs.c (vect_create_data_ref_ptr): Remove
redundant calls to merge_alias_info. redundant calls to merge_alias_info.
(bump_vector_ptr): Likewise. (bump_vector_ptr): Likewise.
......
...@@ -10175,8 +10175,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ...@@ -10175,8 +10175,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
&& TREE_INT_CST_HIGH (tree11) == 0 && TREE_INT_CST_HIGH (tree11) == 0
&& ((TREE_INT_CST_LOW (tree01) + TREE_INT_CST_LOW (tree11)) && ((TREE_INT_CST_LOW (tree01) + TREE_INT_CST_LOW (tree11))
== TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 0))))) == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (arg0, 0)))))
return build2 (LROTATE_EXPR, type, TREE_OPERAND (arg0, 0), return fold_convert (type,
code0 == LSHIFT_EXPR ? tree01 : tree11); build2 (LROTATE_EXPR,
TREE_TYPE (TREE_OPERAND (arg0, 0)),
TREE_OPERAND (arg0, 0),
code0 == LSHIFT_EXPR
? tree01 : tree11));
else if (code11 == MINUS_EXPR) else if (code11 == MINUS_EXPR)
{ {
tree tree110, tree111; tree tree110, tree111;
...@@ -10190,10 +10194,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ...@@ -10190,10 +10194,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
(TREE_TYPE (TREE_OPERAND (TREE_TYPE (TREE_OPERAND
(arg0, 0)))) (arg0, 0))))
&& operand_equal_p (tree01, tree111, 0)) && operand_equal_p (tree01, tree111, 0))
return build2 ((code0 == LSHIFT_EXPR return fold_convert (type,
? LROTATE_EXPR build2 ((code0 == LSHIFT_EXPR
: RROTATE_EXPR), ? LROTATE_EXPR
type, TREE_OPERAND (arg0, 0), tree01); : RROTATE_EXPR),
TREE_TYPE (TREE_OPERAND (arg0, 0)),
TREE_OPERAND (arg0, 0), tree01));
} }
else if (code01 == MINUS_EXPR) else if (code01 == MINUS_EXPR)
{ {
...@@ -10208,10 +10214,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1) ...@@ -10208,10 +10214,12 @@ fold_binary (enum tree_code code, tree type, tree op0, tree op1)
(TREE_TYPE (TREE_OPERAND (TREE_TYPE (TREE_OPERAND
(arg0, 0)))) (arg0, 0))))
&& operand_equal_p (tree11, tree011, 0)) && operand_equal_p (tree11, tree011, 0))
return build2 ((code0 != LSHIFT_EXPR return fold_convert (type,
? LROTATE_EXPR build2 ((code0 != LSHIFT_EXPR
: RROTATE_EXPR), ? LROTATE_EXPR
type, TREE_OPERAND (arg0, 0), tree11); : RROTATE_EXPR),
TREE_TYPE (TREE_OPERAND (arg0, 0)),
TREE_OPERAND (arg0, 0), tree11));
} }
} }
} }
......
2009-05-26 Richard Guenther <rguenther@suse.de>
PR middle-end/40252
* gcc.c-torture/compile/pr40252.c: New testcase.
2009-05-26 Dodji Seketeli <dodji@redhat.com> 2009-05-26 Dodji Seketeli <dodji@redhat.com>
PR c++/40007 PR c++/40007
......
typedef unsigned int uint32_t;
static void IP(uint32_t v[2])
{
v[0] = ((v[0] << 1) | ((v[0] >> 31) & 1L)) & 0xffffffffL;
}
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