From f4da258f520dd886a7a1dd9d1c4d71c02f68b46a Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Mon, 25 Jul 2011 15:41:55 +0000 Subject: [PATCH] re PR target/39386 ([avr] different computation results for O1 and O0 executables) PR target/39386 * config/avr/avr.c (out_shift_with_cnt): Use tmp_reg as shift counter for x << x and x >> x shifts. From-SVN: r176756 --- gcc/ChangeLog | 6 ++++++ gcc/config/avr/avr.c | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 335e65e1df4..d3178e3d3ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-07-25 Georg-Johann Lay + + PR target/39386 + * config/avr/avr.c (out_shift_with_cnt): Use tmp_reg as + shift counter for x << x and x >> x shifts. + 2011-07-25 Rainer Orth PR target/47124 diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 4951f56e092..eb1707e922b 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -3147,8 +3147,11 @@ out_shift_with_cnt (const char *templ, rtx insn, rtx operands[], } else if (register_operand (operands[2], QImode)) { - if (reg_unused_after (insn, operands[2])) - op[3] = op[2]; + if (reg_unused_after (insn, operands[2]) + && !reg_overlap_mentioned_p (operands[0], operands[2])) + { + op[3] = op[2]; + } else { op[3] = tmp_reg_rtx; -- 2.30.2