From 98ac6510fa40424a33df9cd8fabb0cdc18e147e7 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 10 Jul 2009 23:16:31 +0000 Subject: [PATCH] thumb2.md (thumb2_cbz): Correct computation of length attribute. * config/arm/thumb2.md (thumb2_cbz): Correct computation of length attribute. (thumb2_cbnz): Likewise. From-SVN: r149501 --- gcc/ChangeLog | 6 ++++++ gcc/config/arm/thumb2.md | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bff4bd70ac3..50c7a1c650b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-07-10 Mark Mitchell + + * config/arm/thumb2.md (thumb2_cbz): Correct computation of length + attribute. + (thumb2_cbnz): Likewise. + 2009-07-10 David Daney PR target/39079 diff --git a/gcc/config/arm/thumb2.md b/gcc/config/arm/thumb2.md index 0c5c2dbd9ce..884d58c7677 100644 --- a/gcc/config/arm/thumb2.md +++ b/gcc/config/arm/thumb2.md @@ -1325,7 +1325,7 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_THUMB2" "* - if (get_attr_length (insn) == 2 && which_alternative == 0) + if (get_attr_length (insn) == 2) return \"cbz\\t%0, %l1\"; else return \"cmp\\t%0, #0\;beq\\t%l1\"; @@ -1333,7 +1333,8 @@ [(set (attr "length") (if_then_else (and (ge (minus (match_dup 1) (pc)) (const_int 2)) - (le (minus (match_dup 1) (pc)) (const_int 128))) + (le (minus (match_dup 1) (pc)) (const_int 128)) + (eq (symbol_ref ("which_alternative")) (const_int 0))) (const_int 2) (const_int 8)))] ) @@ -1347,7 +1348,7 @@ (clobber (reg:CC CC_REGNUM))] "TARGET_THUMB2" "* - if (get_attr_length (insn) == 2 && which_alternative == 0) + if (get_attr_length (insn) == 2) return \"cbnz\\t%0, %l1\"; else return \"cmp\\t%0, #0\;bne\\t%l1\"; @@ -1355,7 +1356,8 @@ [(set (attr "length") (if_then_else (and (ge (minus (match_dup 1) (pc)) (const_int 2)) - (le (minus (match_dup 1) (pc)) (const_int 128))) + (le (minus (match_dup 1) (pc)) (const_int 128)) + (eq (symbol_ref ("which_alternative")) (const_int 0))) (const_int 2) (const_int 8)))] ) -- 2.30.2