Commit 67fccea4 by Richard Biener Committed by Richard Biener

re PR middle-end/85974 (Failure to optimize difference of two pointers into a…

re PR middle-end/85974 (Failure to optimize difference of two pointers into a compile time constant)

2018-07-13  Richard Biener  <rguenther@suse.de>

	PR middle-end/85974
	* match.pd (addr1 - addr2): Allow either of the operand to
	have a conversion.

	* gcc.c-torture/compile/930326-1.c: Adjust to cover widening.

From-SVN: r262632
parent 22539827
2018-07-13 Richard Biener <rguenther@suse.de>
PR middle-end/85974
* match.pd (addr1 - addr2): Allow either of the operand to
have a conversion.
2018-07-13 Tom de Vries <tdevries@suse.de>
* tree-inline.c (remap_ssa_name): Save and reuse debug exprs generated
......
......@@ -1673,14 +1673,14 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(if (ptr_difference_const (@0, @1, &diff))
{ build_int_cst_type (type, diff); }))))
(simplify
(pointer_diff (convert?@2 ADDR_EXPR@0) (convert?@3 @1))
(pointer_diff (convert?@2 ADDR_EXPR@0) (convert1?@3 @1))
(if (tree_nop_conversion_p (TREE_TYPE(@2), TREE_TYPE (@0))
&& tree_nop_conversion_p (TREE_TYPE(@3), TREE_TYPE (@1)))
(with { poly_int64 diff; }
(if (ptr_difference_const (@0, @1, &diff))
{ build_int_cst_type (type, diff); }))))
(simplify
(pointer_diff (convert?@2 @0) (convert?@3 ADDR_EXPR@1))
(pointer_diff (convert?@2 @0) (convert1?@3 ADDR_EXPR@1))
(if (tree_nop_conversion_p (TREE_TYPE(@2), TREE_TYPE (@0))
&& tree_nop_conversion_p (TREE_TYPE(@3), TREE_TYPE (@1)))
(with { poly_int64 diff; }
......
2018-07-13 Richard Biener <rguenther@suse.de>
PR middle-end/85974
* gcc.c-torture/compile/930326-1.c: Adjust to cover widening.
2018-07-13 Tom de Vries <tdevries@suse.de>
* gcc.dg/guality/clztest.c: Add -fno-ipa-icf in dg-options.
......
......@@ -4,3 +4,4 @@ struct
} s;
long i = s.f-&s.b;
long long j = s.f-&s.b;
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