mirror of git://gcc.gnu.org/git/gcc.git
re PR middle-end/51750 (FAIL: 25_algorithms/heap/moveable*.cc execution test)
2012-01-04 Richard Guenther <rguenther@suse.de> PR middle-end/51750 * tree.c (size_low_cst): New function. * tree.h (size_low_cst): Declare. * fold-const.c (fold_comparison): Use it to extract the low part of the POINTER_PLUS_EXPR offset. From-SVN: r182872
This commit is contained in:
parent
299c4b5f88
commit
f5a3d840b6
|
|
@ -1,3 +1,11 @@
|
||||||
|
2012-01-04 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
PR middle-end/51750
|
||||||
|
* tree.c (size_low_cst): New function.
|
||||||
|
* tree.h (size_low_cst): Declare.
|
||||||
|
* fold-const.c (fold_comparison): Use it to extract the low
|
||||||
|
part of the POINTER_PLUS_EXPR offset.
|
||||||
|
|
||||||
2012-01-04 Georg-Johann Lay <avr@gjlay.de>
|
2012-01-04 Georg-Johann Lay <avr@gjlay.de>
|
||||||
|
|
||||||
Fix clearing ZERO_REG
|
Fix clearing ZERO_REG
|
||||||
|
|
|
||||||
|
|
@ -8886,15 +8886,18 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
|
||||||
indirect_base0 = true;
|
indirect_base0 = true;
|
||||||
}
|
}
|
||||||
offset0 = TREE_OPERAND (arg0, 1);
|
offset0 = TREE_OPERAND (arg0, 1);
|
||||||
if (host_integerp (offset0, 0)
|
if (host_integerp (offset0, 0))
|
||||||
&& ((HOST_WIDE_INT) (TREE_INT_CST_LOW (offset0) * BITS_PER_UNIT)
|
|
||||||
/ BITS_PER_UNIT
|
|
||||||
== (HOST_WIDE_INT) TREE_INT_CST_LOW (offset0)))
|
|
||||||
{
|
{
|
||||||
bitpos0 = TREE_INT_CST_LOW (offset0) * BITS_PER_UNIT;
|
HOST_WIDE_INT off = size_low_cst (offset0);
|
||||||
|
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
|
||||||
|
* BITS_PER_UNIT)
|
||||||
|
/ BITS_PER_UNIT == (HOST_WIDE_INT) off)
|
||||||
|
{
|
||||||
|
bitpos0 = off * BITS_PER_UNIT;
|
||||||
offset0 = NULL_TREE;
|
offset0 = NULL_TREE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
base1 = arg1;
|
base1 = arg1;
|
||||||
if (TREE_CODE (arg1) == ADDR_EXPR)
|
if (TREE_CODE (arg1) == ADDR_EXPR)
|
||||||
|
|
@ -8917,15 +8920,18 @@ fold_comparison (location_t loc, enum tree_code code, tree type,
|
||||||
indirect_base1 = true;
|
indirect_base1 = true;
|
||||||
}
|
}
|
||||||
offset1 = TREE_OPERAND (arg1, 1);
|
offset1 = TREE_OPERAND (arg1, 1);
|
||||||
if (host_integerp (offset1, 0)
|
if (host_integerp (offset1, 0))
|
||||||
&& ((HOST_WIDE_INT) (TREE_INT_CST_LOW (offset1) * BITS_PER_UNIT)
|
|
||||||
/ BITS_PER_UNIT
|
|
||||||
== (HOST_WIDE_INT) TREE_INT_CST_LOW (offset1)))
|
|
||||||
{
|
{
|
||||||
bitpos1 = TREE_INT_CST_LOW (offset1) * BITS_PER_UNIT;
|
HOST_WIDE_INT off = size_low_cst (offset1);
|
||||||
|
if ((HOST_WIDE_INT) (((unsigned HOST_WIDE_INT) off)
|
||||||
|
* BITS_PER_UNIT)
|
||||||
|
/ BITS_PER_UNIT == (HOST_WIDE_INT) off)
|
||||||
|
{
|
||||||
|
bitpos1 = off * BITS_PER_UNIT;
|
||||||
offset1 = NULL_TREE;
|
offset1 = NULL_TREE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* A local variable can never be pointed to by
|
/* A local variable can never be pointed to by
|
||||||
the default SSA name of an incoming parameter. */
|
the default SSA name of an incoming parameter. */
|
||||||
|
|
|
||||||
11
gcc/tree.c
11
gcc/tree.c
|
|
@ -6509,6 +6509,17 @@ tree_low_cst (const_tree t, int pos)
|
||||||
return TREE_INT_CST_LOW (t);
|
return TREE_INT_CST_LOW (t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the HOST_WIDE_INT least significant bits of T, a sizetype
|
||||||
|
kind INTEGER_CST. This makes sure to properly sign-extend the
|
||||||
|
constant. */
|
||||||
|
|
||||||
|
HOST_WIDE_INT
|
||||||
|
size_low_cst (const_tree t)
|
||||||
|
{
|
||||||
|
double_int d = tree_to_double_int (t);
|
||||||
|
return double_int_sext (d, TYPE_PRECISION (TREE_TYPE (t))).low;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the most significant (sign) bit of T. */
|
/* Return the most significant (sign) bit of T. */
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -4428,6 +4428,7 @@ tree_low_cst (const_tree t, int pos)
|
||||||
return TREE_INT_CST_LOW (t);
|
return TREE_INT_CST_LOW (t);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
extern HOST_WIDE_INT size_low_cst (const_tree);
|
||||||
extern int tree_int_cst_sgn (const_tree);
|
extern int tree_int_cst_sgn (const_tree);
|
||||||
extern int tree_int_cst_sign_bit (const_tree);
|
extern int tree_int_cst_sign_bit (const_tree);
|
||||||
extern unsigned int tree_int_cst_min_precision (tree, bool);
|
extern unsigned int tree_int_cst_min_precision (tree, bool);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue