Commit 1ac12fa2 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/47155 (ccp caused miscompilation)

	PR tree-optimization/47155
	* tree-ssa-ccp.c (bit_value_binop_1): Use r1type instead of type
	when computing uns.

	* gcc.c-torture/execute/pr47155.c: New test.

From-SVN: r168440
parent 9766135b
2011-01-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47155
* tree-ssa-ccp.c (bit_value_binop_1): Use r1type instead of type
when computing uns.
PR rtl-optimization/47157
* combine.c (try_combine): If undobuf.other_insn becomes
(set (pc) (pc)) jump, call update_cfg_for_uncondjump on it
......
2011-01-03 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/47155
* gcc.c-torture/execute/pr47155.c: New test.
PR rtl-optimization/47157
* gcc.c-torture/compile/pr47157.c: New test.
......
/* PR tree-optimization/47155 */
unsigned int a;
static signed char b = -127;
int c = 1;
int
main (void)
{
a = b <= (unsigned char) (-6 * c);
if (!a)
__builtin_abort ();
return 0;
}
......@@ -1764,8 +1764,8 @@ bit_value_binop_1 (enum tree_code code, tree type,
tree r1type, double_int r1val, double_int r1mask,
tree r2type, double_int r2val, double_int r2mask)
{
bool uns = (TREE_CODE (type) == INTEGER_TYPE
&& TYPE_IS_SIZETYPE (type) ? 0 : TYPE_UNSIGNED (type));
bool uns = (TREE_CODE (r1type) == INTEGER_TYPE
&& TYPE_IS_SIZETYPE (r1type) ? 0 : TYPE_UNSIGNED (r1type));
/* Assume we'll get a constant result. Use an initial varying value,
we fall back to varying in the end if necessary. */
*mask = double_int_minus_one;
......
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