aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@gcc.gnu.org>2011-05-30 22:56:32 +0000
committerKaz Kojima <kkojima@gcc.gnu.org>2011-05-30 22:56:32 +0000
commit5f1330380a45aa4d5eb5da773ce0e394418008c7 (patch)
tree724192e63c606bbe59e0a272aec467499c454417
parent283e624c9f8007a9048b55e3be3dfad991cff346 (diff)
downloadgcc-5f1330380a45aa4d5eb5da773ce0e394418008c7.zip
gcc-5f1330380a45aa4d5eb5da773ce0e394418008c7.tar.gz
gcc-5f1330380a45aa4d5eb5da773ce0e394418008c7.tar.bz2
sh.c (expand_cbranchdi4): Set msw_skip when the high part of the second operand is 0.
* 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: r174456
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/sh/sh.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr49186.c15
4 files changed, 30 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 20a3938..0e97381 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+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-30 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.md (*movxf_internal): Penalize FYx*r->o alternative
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 94c8ba4..fb204c6 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -2143,7 +2143,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;
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d8b0ef5..d9bfc91 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-30 Kaz Kojima <kkojima@gcc.gnu.org>
+
+ PR target/49186
+ * gcc.c-torture/execute/pr49186.c: New.
+
2011-05-30 H.J. Lu <hongjiu.lu@intel.com>
PR target/49168
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr49186.c b/gcc/testsuite/gcc.c-torture/execute/pr49186.c
new file mode 100644
index 0000000..743815b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr49186.c
@@ -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;
+}