re PR target/39386 ([avr] different computation results for O1 and O0 executables)
authorGeorg-Johann Lay <avr@gjlay.de>
Mon, 25 Jul 2011 15:41:55 +0000 (15:41 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Mon, 25 Jul 2011 15:41:55 +0000 (15:41 +0000)
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
gcc/config/avr/avr.c

index 335e65e1df4c18240ffd42a9f93d4c0f04cbd66f..d3178e3d3ee2351e0e81d57c0f7015cdc0788741 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-25  Georg-Johann Lay  <avr@gjlay.de>
+       
+       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  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        PR target/47124
index 4951f56e092d3194d2c00d3699fa9da5b33235e5..eb1707e922bac653d5777e266078722df5c5ce1d 100644 (file)
@@ -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;