From: Georg-Johann Lay Date: Wed, 23 Nov 2016 09:17:57 +0000 (+0000) Subject: re PR target/60300 ([avr] Suboptimal stack pointer manipulation for frame setup) X-Git-Tag: upstream/12.2.0~43077 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a80504892ef9696ffe81248667798f1ac7d5a678;p=platform%2Fupstream%2Fgcc.git re PR target/60300 ([avr] Suboptimal stack pointer manipulation for frame setup) gcc/ 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. From-SVN: r242741 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ea39ef0..92abe52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-11-23 Georg-Johann Lay + + 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 * config/aarch64/aarch64-protos.h diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 7f3f93d..b6b1756 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -1687,7 +1687,11 @@ avr_prologue_setup_frame (HOST_WIDE_INT size, HARD_REG_SET set) /* 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; diff --git a/gcc/config/avr/constraints.md b/gcc/config/avr/constraints.md index 80cff0c..4836e3c 100644 --- a/gcc/config/avr/constraints.md +++ b/gcc/config/avr/constraints.md @@ -189,9 +189,9 @@ (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."