]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/49186 (optimize problem with unsigned long long value.)
authorKaz Kojima <kkojima@gcc.gnu.org>
Sun, 5 Jun 2011 21:55:46 +0000 (21:55 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Sun, 5 Jun 2011 21:55:46 +0000 (21:55 +0000)
PR target/49186
* config/sh/sh.c (expand_cbranchdi4): Set msw_skip when the high
part of the second operand is 0.
* gcc.c-torture/execute/pr49186.c: New.

From-SVN: r174668

gcc/ChangeLog
gcc/config/sh/sh.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/pr49186.c [new file with mode: 0644]

index 0b9d0a08023c935f664ff84619d500c5c6ad58af..27eb7e8df3e96d9fd31c4914714204b8db3da256 100644 (file)
@@ -1,3 +1,12 @@
+2011-06-05  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       Backport from mainline
+       2011-05-30  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/49186
+       * config/sh/sh.c (expand_cbranchdi4): Set msw_skip when the high
+       part of the second operand is 0.
+
 2011-05-24  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        Backport from mainline:
index 7748153343e5ecb8a0c3a3d2ef3167d6952e0dbf..418bdf638581e28fce246fd43ba30d416c5e853d 100644 (file)
@@ -1566,7 +1566,10 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
          else if (op2h != CONST0_RTX (SImode))
            msw_taken = LTU;
          else
-           break;
+           {
+             msw_skip = swap_condition (LTU);
+             break;
+           }
          msw_skip = swap_condition (msw_taken);
        }
       break;
index a4dffe2b1a7dc3fa18b286f0b18796c571f7d6cf..0ce09c12549bf558a92b893696a38c726184936e 100644 (file)
@@ -1,3 +1,11 @@
+2011-06-05  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       Backport from mainline
+       2011-05-30  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR target/49186
+       * gcc.c-torture/execute/pr49186.c: New.
+
 2011-05-20  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/init/new32.C: New.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49186.c b/gcc/testsuite/gcc.c-torture/execute/pr49186.c
new file mode 100644 (file)
index 0000000..743815b
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR target/49186 */
+extern void abort (void);
+
+int
+main ()
+{
+  int x;
+  unsigned long long uv = 0x1000000001ULL;
+
+  x = (uv < 0x80) ? 1 : ((uv < 0x800) ? 2 : 3);
+  if (x != 3)
+    abort ();
+
+  return 0;
+}