tree-ssa-forwprop.c (simplify_bitwise_binary): Fix typo.
authorKai Tietz <ktietz@redhat.com>
Fri, 1 Jul 2011 10:00:25 +0000 (12:00 +0200)
committerKai Tietz <ktietz@gcc.gnu.org>
Fri, 1 Jul 2011 10:00:25 +0000 (12:00 +0200)
2011-07-01  Kai Tietz  <ktietz@redhat.com>

        * tree-ssa-forwprop.c (simplify_bitwise_binary): Fix typo.

2011-07-01  Kai Tietz  <ktietz@redhat.com>

        * gcc.dg/tree-ssa/bitwise-sink.c: New test.

From-SVN: r175752

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.c

index df258a51c734e400919f67d0ce656653079978de..e0ceee862185cb32eb25f219f45f7063bb408c05 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-01  Kai Tietz  <ktietz@redhat.com>
+
+       * tree-ssa-forwprop.c (simplify_bitwise_binary): Fix typo.
+
 2011-07-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config.gcc: Obsolete alpha*-dec-osf5.1, mips-sgi-irix6.5.
index 9b7219790fc3a40019ed7508045b0f8a3f8509d8..857ed564f8a5047473d320ff6a26a1b3518ab856 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-01  Kai Tietz  <ktietz@redhat.com>
+
+        * gcc.dg/tree-ssa/bitwise-sink.c: New test.
+
 2011-07-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR libmudflap/49549
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c b/gcc/testsuite/gcc.dg/tree-ssa/bitwise-sink.c
new file mode 100644 (file)
index 0000000..f445299
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+int
+foo (_Bool x)
+{
+  return (x ^ 1);
+}
+
+/* { dg-final { scan-tree-dump-times "x\[^ \]* \\^ 1" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
index e93acdfc081ac9da4ba000991ae37da2337de563..893f17b47a4082775aac19ce640cdf5299e0e152 100644 (file)
@@ -1675,7 +1675,7 @@ simplify_bitwise_binary (gimple_stmt_iterator *gsi)
   /* Try to fold (type) X op CST -> (type) (X op ((type-x) CST)).  */
   if (TREE_CODE (arg2) == INTEGER_CST
       && CONVERT_EXPR_CODE_P (def1_code)
-      && INTEGRAL_TYPE_P (def1_arg1)
+      && INTEGRAL_TYPE_P (TREE_TYPE (def1_arg1))
       && int_fits_type_p (arg2, TREE_TYPE (def1_arg1)))
     {
       gimple newop;