aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2010-09-09 12:36:10 +0200
committerUros Bizjak <uros@gcc.gnu.org>2010-09-09 12:36:10 +0200
commitd2795d5831eaa87fe3945a354801d09a40925f56 (patch)
treec01a8af74679df226237af567f181cb82690b785
parentbd29d5193a42a7fbe92c5052fa8d28f35290c823 (diff)
downloadgcc-d2795d5831eaa87fe3945a354801d09a40925f56.zip
gcc-d2795d5831eaa87fe3945a354801d09a40925f56.tar.gz
gcc-d2795d5831eaa87fe3945a354801d09a40925f56.tar.bz2
predicates.md (ext_register_operand): Check that SUBREG_REG is really a register before looking for REGNO.
* config/i386/predicates.md (ext_register_operand): Check that SUBREG_REG is really a register before looking for REGNO. (reg_not_xmm0_operand): Handle SUBREGs correctly. (nonimm_not_xmm0_operand): Call reg_not_xmm0_operand. From-SVN: r164071
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/i386/predicates.md16
2 files changed, 18 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b815a39..c50575b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2010-09-09 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/predicates.md (ext_register_operand): Check that
+ SUBREG_REG is really a register before looking for REGNO.
+ (reg_not_xmm0_operand): Handle SUBREGs correctly.
+ (nonimm_not_xmm0_operand): Call reg_not_xmm0_operand.
+
2010-09-09 Jakub Jelinek <jakub@redhat.com>
* rtl.def (DEBUG_IMPLICIT_PTR): New rtl code.
diff --git a/gcc/config/i386/predicates.md b/gcc/config/i386/predicates.md
index 8fe0f34..56a92bd 100644
--- a/gcc/config/i386/predicates.md
+++ b/gcc/config/i386/predicates.md
@@ -68,7 +68,8 @@
op = SUBREG_REG (op);
/* Be careful to accept only registers having upper parts. */
- return REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) <= BX_REG;
+ return (REG_P (op)
+ && (REGNO (op) > LAST_VIRTUAL_REGISTER || REGNO (op) <= BX_REG));
})
;; Return true if op is the AX register.
@@ -97,13 +98,18 @@
;; Return true if op is not xmm0 register.
(define_predicate "reg_not_xmm0_operand"
- (and (match_operand 0 "register_operand")
- (match_test "REGNO (op) != FIRST_SSE_REG")))
+ (match_operand 0 "register_operand")
+{
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ return !REG_P (op) || REGNO (op) != FIRST_SSE_REG;
+})
;; As above, but allow nonimmediate operands.
(define_predicate "nonimm_not_xmm0_operand"
- (ior (match_operand 0 "memory_operand")
- (match_operand 0 "reg_not_xmm0_operand")))
+ (ior (match_operand 0 "memory_operand")
+ (match_operand 0 "reg_not_xmm0_operand")))
;; Return true if VALUE can be stored in a sign extended immediate field.
(define_predicate "x86_64_immediate_operand"