This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][match-and-simplify] Fix bogus transform


Transcribe error from forwprop, catched by pr54767.f90 in the
fortran torture.

Committed.

2014-06-05  Richard Biener  <rguenther@suse.de>

	* match.pd: Fix bogus (~x & y) | x -> x & y transform which
	should have simplified to x | y.

Index: gcc/match.pd
===================================================================
--- gcc/match.pd	(revision 211258)
+++ gcc/match.pd	(working copy)
@@ -356,11 +356,11 @@ to (minus @1 @0)
   if (INTEGRAL_TYPE_P (TREE_TYPE (@0)))
   (bit_and @0 @1))
 
-/* (~x & y) | x -> x & y */
+/* (~x & y) | x -> x | y */
 (match_and_simplify
   (bit_ior (bit_and (bit_not @0) @1) @0)
   if (INTEGRAL_TYPE_P (TREE_TYPE (@0)))
-  (bit_and @0 @1))
+  (bit_ior @0 @1))
 
 /* ~~x -> x */
 (match_and_simplify


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]