re PR tree-optimization/61559 (FAIL: gcc.dg/builtin-bswap-8.c on i686 with -mmovbe)
authorRichard Biener <rguenther@suse.de>
Thu, 13 Nov 2014 08:45:29 +0000 (08:45 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 13 Nov 2014 08:45:29 +0000 (08:45 +0000)
2014-12-13  Richard Biener  <rguenther@suse.de>

PR middle-end/61559
* match.pd: Implement bswap patterns for transforms checked by
gcc.dg/builtin-bswap-8.c.

From-SVN: r217464

gcc/ChangeLog
gcc/match.pd

index 90b9639bf92e689affccabbf39760dea375e5a93..d32aa4f32bd2c95588f0f845953af79327bc2128 100644 (file)
@@ -1,3 +1,9 @@
+2014-12-13  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/61559
+       * match.pd: Implement bswap patterns for transforms checked by
+       gcc.dg/builtin-bswap-8.c.
+
 2014-11-13  Vladimir Makarov  <vmakarov@redhat.com>
 
        * lra.c (lra): Switch off rematerialization pass.
index d94a8f5141827c2c5985ec2e252707438581ec97..1d7b153af8190a013472ac9b3fca6b5d55b5f5e0 100644 (file)
@@ -576,3 +576,17 @@ along with GCC; see the file COPYING3.  If not see
 (simplify
  (imagpart (complex @0 @1))
  @1)
+
+
+/* BSWAP simplifications, transforms checked by gcc.dg/builtin-bswap-8.c.  */
+(for bswap (BUILT_IN_BSWAP16 BUILT_IN_BSWAP32 BUILT_IN_BSWAP64)
+ (simplify
+  (bswap (bswap @0))
+  @0)
+ (simplify
+  (bswap (bit_not (bswap @0)))
+  (bit_not @0))
+ (for bitop (bit_xor bit_ior bit_and)
+  (simplify
+   (bswap (bitop:c (bswap @0) @1))
+   (bitop @0 (bswap @1)))))