On Thu, 21 Aug 2014, Marc Glisse wrote:
On Thu, 21 Aug 2014, Richard Biener wrote:
2014-08-21 Richard Biener rguent...@suse.de
* match.pd ((T1)(~(T2) X) - ~(T1) X): Paste all comment
from fold-const.c, fix simplification result.
Index: gcc/match.pd
This adds the capability to auto-guess the type of non-outermost
conversions by looking at the parent expression type. This also
adds fatal () to the cases we can't auto-detect.
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
2014-08-21 Richard Biener
On Thu, 21 Aug 2014, Richard Biener wrote:
+/* From fold_unary. */
+
+/* (T1)(~(T2) X) - ~(T1) X */
+(simplify
+ (convert (bit_not@0 (convert @1)))
+ (if (INTEGRAL_TYPE_P (type)
+ INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))
+
On Thu, 21 Aug 2014, Marc Glisse wrote:
On Thu, 21 Aug 2014, Richard Biener wrote:
+/* From fold_unary. */
+
+/* (T1)(~(T2) X) - ~(T1) X */
+(simplify
+ (convert (bit_not@0 (convert @1)))
+ (if (INTEGRAL_TYPE_P (type)
+ INTEGRAL_TYPE_P (TREE_TYPE (@0))
+
On Thu, 21 Aug 2014, Richard Biener wrote:
2014-08-21 Richard Biener rguent...@suse.de
* match.pd ((T1)(~(T2) X) - ~(T1) X): Paste all comment
from fold-const.c, fix simplification result.
Index: gcc/match.pd