]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/39633 ([avr] loop bug: missing 8-bit comparison (*cmpqi))
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 2 May 2012 17:14:32 +0000 (17:14 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Wed, 2 May 2012 17:14:32 +0000 (17:14 +0000)
Backport from 2011-07-11 4.6-branch r176143
PR target/39633
* config/avr/avr.c (notice_update_cc): For ashiftrt:QI, only
offsets 1..5 set cc0 in a usable way.

From-SVN: r187056

gcc/ChangeLog
gcc/config/avr/avr.c

index a3c01a31b7d9e0d53dc9890814e7da6578b377c7..994658fdaf5a9b8ac6ba3ea7086986d6ed735cd1 100644 (file)
@@ -1,3 +1,11 @@
+2012-05-02  Georg-Johann Lay  <avr@gjlay.de>
+
+       Backport from 2011-07-11 4.6-branch r176143
+
+       PR target/39633
+       * config/avr/avr.c (notice_update_cc): For ashiftrt:QI, only
+       offsets 1..5 set cc0 in a usable way.
+
 2012-05-02  Georg-Johann Lay  <avr@gjlay.de>
 
        Backport from 2011-07-08 4.6-branch r176055.
index c8655bd517dc383897a5e3d19713aac459093ec2..d5ec58af50305f17ca1645d9ceccb3de41f793aa 100644 (file)
@@ -1385,9 +1385,8 @@ notice_update_cc (rtx body ATTRIBUTE_UNUSED, rtx insn)
            {
              rtx x = XEXP (src, 1);
 
-             if (GET_CODE (x) == CONST_INT
-                 && INTVAL (x) > 0
-                 && INTVAL (x) != 6)
+             if (CONST_INT_P (x)
+                 && IN_RANGE (INTVAL (x), 1, 5))
                {
                  cc_status.value1 = SET_DEST (set);
                  cc_status.flags |= CC_OVERFLOW_UNUSABLE;