diff mbox

Add x | 0 -> x pattern

Message ID alpine.LSU.2.11.1608190859150.26629@t29.fhfr.qr
State New
Headers show

Commit Message

Richard Biener Aug. 19, 2016, 6:59 a.m. UTC
For some reason it was missing.

Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.

Richard.

2016-08-19  Richard Biener  <rguenther@suse.de>

	* match.pd (x | 0 -> x): Add.
diff mbox

Patch

Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 239570)
+++ gcc/match.pd	(working copy)
@@ -541,13 +541,18 @@  DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
 
 /* x | ~0 -> ~0  */
 (simplify
-  (bit_ior @0 integer_all_onesp@1)
-  @1)
+ (bit_ior @0 integer_all_onesp@1)
+ @1)
+
+/* x | 0 -> x  */
+(simplify
+ (bit_ior @0 integer_zerop)
+ @0)
 
 /* x & 0 -> 0  */
 (simplify
-  (bit_and @0 integer_zerop@1)
-  @1)
+ (bit_and @0 integer_zerop@1)
+ @1)
 
 /* ~x | x -> -1 */
 /* ~x ^ x -> -1 */