+2016-11-23 Georg-Johann Lay <avr@gjlay.de>
+
+ PR target/60300
+ * config/avr/constraints.md (Csp): Widen range to [-11..6].
+ * config/avr/avr.c (avr_prologue_setup_frame): Limit number
+ of RCALLs in prologue to 3.
+
2016-11-22 Michael Collison <michael.collison@arm.com>
* config/aarch64/aarch64-protos.h
/* Stack adjustment by means of RCALL . and/or PUSH __TMP_REG__
can only handle specific offsets. */
- if (avr_sp_immediate_operand (gen_int_mode (-size, HImode), HImode))
+ int n_rcall = size / (AVR_3_BYTE_PC ? 3 : 2);
+
+ if (avr_sp_immediate_operand (gen_int_mode (-size, HImode), HImode)
+ // Don't use more than 3 RCALLs.
+ && n_rcall <= 3)
{
rtx_insn *sp_plus_insns;
(match_test "avr_popcount_each_byte (op, 4, (1<<0) | (1<<8))")))
(define_constraint "Csp"
- "Integer constant in the range -6 @dots{} 6."
+ "Integer constant in the range -11 @dots{} 6."
(and (match_code "const_int")
- (match_test "IN_RANGE (ival, -6, 6)")))
+ (match_test "IN_RANGE (ival, -11, 6)")))
(define_constraint "Cxf"
"32-bit integer constant where at least one nibble is 0xf."