diff options
| author | Marc Glisse <marc.glisse@inria.fr> | 2017-05-18 13:05:55 +0200 | 
|---|---|---|
| committer | Marc Glisse <glisse@gcc.gnu.org> | 2017-05-18 11:05:55 +0000 | 
| commit | 8b656ca7ea26bb53e6058c10c0016e080c39930c (patch) | |
| tree | bad2b7bb3b9a02a1e6c6b9b76e1d5f4956ef07ed /gcc/fold-const.c | |
| parent | e3455240edf5c8fa4ee4ee73219b35ce1265b076 (diff) | |
| download | gcc-8b656ca7ea26bb53e6058c10c0016e080c39930c.zip gcc-8b656ca7ea26bb53e6058c10c0016e080c39930c.tar.gz gcc-8b656ca7ea26bb53e6058c10c0016e080c39930c.tar.bz2 | |
Move X==15-X to match.pd
2017-05-18  Marc Glisse  <marc.glisse@inria.fr>
	* fold-const.c (fold_binary_loc): Move transformation...
	* match.pd (C - X CMP X): ... here.
From-SVN: r248193
Diffstat (limited to 'gcc/fold-const.c')
| -rw-r--r-- | gcc/fold-const.c | 24 | 
1 files changed, 0 insertions, 24 deletions
| diff --git a/gcc/fold-const.c b/gcc/fold-const.c index f6d5af4..19aa722 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10532,30 +10532,6 @@ fold_binary_loc (location_t loc,  					TREE_OPERAND (arg1, 0), arg0);  	} -      /* Transform comparisons of the form C - X CMP X if C % 2 == 1.  */ -      if (TREE_CODE (arg0) == MINUS_EXPR -	  && TREE_CODE (TREE_OPERAND (arg0, 0)) == INTEGER_CST -	  && operand_equal_p (tree_strip_nop_conversions (TREE_OPERAND (arg0, -									1)), -			      arg1, 0) -	  && wi::extract_uhwi (TREE_OPERAND (arg0, 0), 0, 1) == 1) -	return omit_two_operands_loc (loc, type, -				      code == NE_EXPR -				      ? boolean_true_node : boolean_false_node, -				      TREE_OPERAND (arg0, 1), arg1); - -      /* Transform comparisons of the form X CMP C - X if C % 2 == 1.  */ -      if (TREE_CODE (arg1) == MINUS_EXPR -	  && TREE_CODE (TREE_OPERAND (arg1, 0)) == INTEGER_CST -	  && operand_equal_p (tree_strip_nop_conversions (TREE_OPERAND (arg1, -									1)), -			      arg0, 0) -	  && wi::extract_uhwi (TREE_OPERAND (arg1, 0), 0, 1) == 1) -	return omit_two_operands_loc (loc, type, -				      code == NE_EXPR -				      ? boolean_true_node : boolean_false_node, -				      TREE_OPERAND (arg1, 1), arg0); -        /* If this is an EQ or NE comparison with zero and ARG0 is  	 (1 << foo) & bar, convert it to (bar >> foo) & 1.  Both require  	 two operations, but the latter can be done in one less insn | 
