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 df258a5..e0ceee8 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 9b72197..857ed56 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 e93acdf..893f17b 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;