]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/11805
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2003 13:13:18 +0000 (13:13 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Aug 2003 13:13:18 +0000 (13:13 +0000)
* config/h8300/h8300.md (two anonymous patterns): Remove.
* testsuite/gcc.c-torture/compile/20030821-1.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@70643 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/h8300/h8300.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20030821-1.c [new file with mode: 0644]

index 0537af7b419fd39faceba2a018986b5d6a4a594c..6d8de7de8d77880e60e7b5c417171e59d1d3b523 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-21  Kazu Hirata  <kazu@cs.umass.edu>
+
+       PR target/11805
+       * config/h8300/h8300.md (two anonymous patterns): Remove.
+
 2003-08-21  Richard Sandiford  <rsandifo@redhat.com>
 
        * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause.
index 8fe74507cd0aaae672355fa14e9ca65632ef519e..b17a03ead80f9762d6f9039d04be54f544f829cf 100644 (file)
                         (match_dup 3)))]
   "operands[3] = GEN_INT (INTVAL (operands[1]) - 16);")
 
-(define_insn ""
-  [(set (cc0)
-       (and:HI (match_operand:HI 0 "register_operand" "r")
-               (match_operand:HI 1 "single_one_operand" "n")))]
-  ""
-  "*
-{
-  operands[1] = GEN_INT (INTVAL (operands[1]) & 0xffff);
-  if (INTVAL (operands[1]) > 128)
-    {
-      operands[1] = GEN_INT (INTVAL (operands[1]) >> 8);
-      return \"btst\\t%V1,%t0\";
-    }
-  return \"btst\\t%V1,%s0\";
-}"
-  [(set_attr "length" "2")
-   (set_attr "cc" "set_zn")])
-
-(define_insn ""
-  [(set (cc0)
-       (and:SI (match_operand:SI 0 "register_operand" "r")
-               (match_operand:SI 1 "single_one_operand" "n")))]
-  "(TARGET_H8300H || TARGET_H8300S)
-   && (INTVAL (operands[1]) & 0xffff) != 0"
-  "*
-{
-  operands[1] = GEN_INT (INTVAL (operands[1]) & 0xffff);
-  if (INTVAL (operands[1]) > 128)
-    {
-      operands[1] = GEN_INT (INTVAL (operands[1]) >> 8);
-      return \"btst\\t%V1,%x0\";
-    }
-  return \"btst\\t%V1,%w0\";
-}"
-  [(set_attr "length" "2")
-   (set_attr "cc" "set_zn")])
-
 (define_insn "tstqi"
   [(set (cc0) (match_operand:QI 0 "register_operand" "r"))]
   ""
index 567065258e5892ba488773a2615a678491dd0a18..65d03080db4c90f7ee5dbbc3b998b83b0d06e9ab 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-21  Kazu Hirata  <kazu@cs.umass.edu>
+
+       PR target/11805
+       * gcc.c-torture/compile/20030821-1.c: New.
+
 2003-08-20  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/11834
diff --git a/gcc/testsuite/gcc.c-torture/compile/20030821-1.c b/gcc/testsuite/gcc.c-torture/compile/20030821-1.c
new file mode 100644 (file)
index 0000000..34700ae
--- /dev/null
@@ -0,0 +1,24 @@
+/* PR target/11805.  */
+
+/* Consider the following sequence.
+
+     (set (cc0)
+         (and:HI (reg:HI 0)
+                 (const_int 1)))
+
+     (set (pc)
+         (if_then_else (le (cc0)
+                           (const_int 0))
+                       (label_ref 17)
+                       (pc)))
+
+   On h8300, the first insn does not set the overflow flag, but the
+   second requires the overflow flag.  As a result, when the final
+   wants to output the jump insn, it cannot find a test insn that
+   gives appropriate condition flags.  */
+
+unsigned char
+foo (unsigned char a)
+{
+  return (a & 1) > 0;
+}