Index: gcc/gcc/config/avr/predicates.md |
diff --git a/gcc/gcc/config/avr/predicates.md b/gcc/gcc/config/avr/predicates.md |
index 020fb5f33525e7d317783bd411d8875d50482b01..9a3473bf88f549114ca8269bb551872e02eaee33 100755 |
--- a/gcc/gcc/config/avr/predicates.md |
+++ b/gcc/gcc/config/avr/predicates.md |
@@ -71,6 +71,29 @@ |
(define_predicate "symbol_ref_operand" |
(match_code "symbol_ref")) |
+;; Return true if OP is a text segment reference. |
+;; This is needed for program memory address expressions. |
+(define_predicate "text_segment_operand" |
+ (match_code "code_label,label_ref,symbol_ref,plus,const") |
+{ |
+ switch (GET_CODE (op)) |
+ { |
+ case CODE_LABEL: |
+ return true; |
+ case LABEL_REF : |
+ return true; |
+ case SYMBOL_REF : |
+ return SYMBOL_REF_FUNCTION_P (op); |
+ case PLUS : |
+ /* Assume canonical format of symbol + constant. |
+ Fall through. */ |
+ case CONST : |
+ return text_segment_operand (XEXP (op, 0), VOIDmode); |
+ default : |
+ return false; |
+ } |
+}) |
+ |
;; Return true if OP is a constant that contains only one 1 in its |
;; binary representation. |
(define_predicate "single_one_operand" |
@@ -110,3 +133,8 @@ |
(and (match_code "mem") |
(ior (match_test "register_operand (XEXP (op, 0), mode)") |
(match_test "CONSTANT_ADDRESS_P (XEXP (op, 0))")))) |
+ |
+;; True for register that is pseudo register. |
+(define_predicate "pseudo_register_operand" |
+ (and (match_code "reg") |
+ (match_test "!HARD_REGISTER_P (op)"))) |