===================================================================
@@ -0,0 +1,25 @@
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+char c = 42;
+
+void __attribute__((noinline,noclone))
+pr39633 (char a)
+{
+ a >>= 7;
+ if (a)
+ c = a;
+}
+
+int main()
+{
+ pr39633 (6);
+
+ if (c != 42)
+ abort();
+
+ exit(0);
+
+ return 0;
+}
===================================================================
@@ -1479,9 +1479,8 @@ notice_update_cc (rtx body ATTRIBUTE_UNU
{
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;