+2011-09-30 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/50566
+ * config/avr/avr-protos.h (avr_log_t): New field address_cost.
+ * config/avr/avr.c (avr_address_cost): Use it.
+ * config/avr/avr-log.c (avr_log_set_avr_log): Initialize it.
+ (avr_log_vadump): Unknown %-codes finish printing.
+
2011-09-30 Jakub Jelinek <jakub@redhat.com>
PR inline-asm/50571
abort();
default:
- fputc (*(fmt-1), file);
+ /* Unknown %-code: Stop printing */
+
+ fprintf (file, "??? %%%c ???%s\n", *(fmt-1), fmt);
+ fmt = "";
+
+ break;
}
break; /* % */
}
SET_DUMP_DETAIL (legitimize_address);
SET_DUMP_DETAIL (legitimize_reload_address);
SET_DUMP_DETAIL (constraints);
+ SET_DUMP_DETAIL (address_cost);
#undef SET_DUMP_DETAIL
}
return done;
}
-/* Calculate the cost of a memory address. */
+
+/* Implement `TARGET_ADDRESS_COST'. */
static int
avr_address_cost (rtx x, bool speed ATTRIBUTE_UNUSED)
{
+ int cost = 4;
+
if (GET_CODE (x) == PLUS
- && GET_CODE (XEXP (x,1)) == CONST_INT
- && (REG_P (XEXP (x,0)) || GET_CODE (XEXP (x,0)) == SUBREG)
- && INTVAL (XEXP (x,1)) >= 61)
- return 18;
- if (CONSTANT_ADDRESS_P (x))
+ && CONST_INT_P (XEXP (x, 1))
+ && (REG_P (XEXP (x, 0))
+ || GET_CODE (XEXP (x, 0)) == SUBREG))
{
- if (optimize > 0 && io_address_operand (x, QImode))
- return 2;
- return 4;
+ if (INTVAL (XEXP (x, 1)) >= 61)
+ cost = 18;
}
- return 4;
+ else if (CONSTANT_ADDRESS_P (x))
+ {
+ if (optimize > 0
+ && io_address_operand (x, QImode))
+ cost = 2;
+ }
+
+ if (avr_log.address_cost)
+ avr_edump ("\n%?: %d = %r\n", cost, x);
+
+ return cost;
}
/* Test for extra memory constraint 'Q'.