diff options
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r-- | gcc/config/avr/avr.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 30ea833..4027662 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -56,7 +56,6 @@ static int out_set_stack_ptr PARAMS ((FILE *, int, int)); static RTX_CODE compare_condition PARAMS ((rtx insn)); static int compare_sign_p PARAMS ((rtx insn)); static int reg_was_0 PARAMS ((rtx insn, rtx op)); -static int io_address_p PARAMS ((rtx x, int size)); void debug_hard_reg_set PARAMS ((HARD_REG_SET set)); static tree avr_handle_progmem_attribute PARAMS ((tree *, tree, tree, int, bool *)); static tree avr_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int, bool *)); @@ -1001,7 +1000,8 @@ print_operand_address (file, addr) default: if (CONSTANT_ADDRESS_P (addr) - && (SYMBOL_REF_FLAG (addr) || GET_CODE (addr) == LABEL_REF)) + && ((GET_CODE (addr) == SYMBOL_REF && SYMBOL_REF_FLAG (addr)) + || GET_CODE (addr) == LABEL_REF)) { fprintf (file, "pm("); output_addr_const (file,addr); @@ -1802,7 +1802,7 @@ out_movqi_r_mr (insn, op, l) if (CONSTANT_ADDRESS_P (x)) { - if (io_address_p (x, 1)) + if (avr_io_address_p (x, 1)) { *l = 1; return AS2 (in,%0,%1-0x20); @@ -1971,7 +1971,7 @@ out_movhi_r_mr (insn, op, l) } else if (CONSTANT_ADDRESS_P (base)) { - if (io_address_p (base, 2)) + if (avr_io_address_p (base, 2)) { *l = 2; return (AS2 (in,%A0,%A1-0x20) CR_TAB @@ -2514,7 +2514,7 @@ out_movqi_mr_r (insn, op, l) if (CONSTANT_ADDRESS_P (x)) { - if (io_address_p (x, 1)) + if (avr_io_address_p (x, 1)) { *l = 1; return AS2 (out,%0-0x20,%1); @@ -2592,7 +2592,7 @@ out_movhi_mr_r (insn, op, l) l = &tmp; if (CONSTANT_ADDRESS_P (base)) { - if (io_address_p (base, 2)) + if (avr_io_address_p (base, 2)) { *l = 2; return (AS2 (out,%B0-0x20,%B1) CR_TAB @@ -4927,7 +4927,7 @@ avr_address_cost (x) return 18; if (CONSTANT_ADDRESS_P (x)) { - if (io_address_p (x, 1)) + if (avr_io_address_p (x, 1)) return 2; return 4; } @@ -5246,10 +5246,11 @@ reg_was_0 (insn, op) } /* Returns 1 if X is a valid address for an I/O register of size SIZE - (1 or 2). Used for lds/sts -> in/out optimization. */ + (1 or 2). Used for lds/sts -> in/out optimization. Add 0x20 to SIZE + to check for the lower half of I/O space (for cbi/sbi/sbic/sbis). */ -static int -io_address_p (x, size) +int +avr_io_address_p (x, size) rtx x; int size; { |