aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/avr/avr.c
diff options
context:
space:
mode:
authorMarek Michalkiewicz <marekm@amelek.gda.pl>2002-05-10 14:22:36 +0200
committerMarek Michalkiewicz <marekm@gcc.gnu.org>2002-05-10 12:22:36 +0000
commit1a499b9250dfd05a03485d281e873b437d67bc9e (patch)
treecd8d4e691fea1c61cd8ce9e0eb7a77b6ae4dfba1 /gcc/config/avr/avr.c
parentfbdb9fcec9c18eedea04d8b781024d77a273c60e (diff)
downloadgcc-1a499b9250dfd05a03485d281e873b437d67bc9e.zip
gcc-1a499b9250dfd05a03485d281e873b437d67bc9e.tar.gz
gcc-1a499b9250dfd05a03485d281e873b437d67bc9e.tar.bz2
avr.c (print_operand): Check that addr is a SYMBOL_REF before using SYMBOL_REF_FLAG (addr).
* config/avr/avr.c (print_operand): Check that addr is a SYMBOL_REF before using SYMBOL_REF_FLAG (addr). * config/avr/avr-protos.h (avr_io_address_p): Declare. * config/avr/avr.c (io_address_p): Rename to avr_io_address_p. Make non-static. Update all callers. * config/avr/avr.md (*cbi, *sbi, *sbix_branch, *sbix_branch_bit7): New insns to clear/set/test a single bit in I/O address space. From-SVN: r53359
Diffstat (limited to 'gcc/config/avr/avr.c')
-rw-r--r--gcc/config/avr/avr.c21
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;
{