From 43c446b86f329c5c20c995f71807662f12468a4c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Thu, 21 Aug 2003 13:13:18 +0000 Subject: [PATCH] re PR target/11805 ([H8300] ICE) PR target/11805 * config/h8300/h8300.md (two anonymous patterns): Remove. * testsuite/gcc.c-torture/compile/20030821-1.c: New. From-SVN: r70643 --- gcc/ChangeLog | 5 +++ gcc/config/h8300/h8300.md | 37 ------------------- gcc/testsuite/ChangeLog | 5 +++ .../gcc.c-torture/compile/20030821-1.c | 24 ++++++++++++ 4 files changed, 34 insertions(+), 37 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20030821-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0537af7b419..6d8de7de8d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-08-21 Kazu Hirata + + PR target/11805 + * config/h8300/h8300.md (two anonymous patterns): Remove. + 2003-08-21 Richard Sandiford * config/mips/mips.h (MUST_PASS_IN_STACK): Remove BLKmode clause. diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 8fe74507cd0..b17a03ead80 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -652,43 +652,6 @@ (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"))] "" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 567065258e5..65d03080db4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-08-21 Kazu Hirata + + PR target/11805 + * gcc.c-torture/compile/20030821-1.c: New. + 2003-08-20 Mark Mitchell 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 index 00000000000..34700ae181f --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20030821-1.c @@ -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; +}