From 5f1330380a45aa4d5eb5da773ce0e394418008c7 Mon Sep 17 00:00:00 2001 From: Kaz Kojima Date: Mon, 30 May 2011 22:56:32 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/config/sh/sh.c | 5 ++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.c-torture/execute/pr49186.c | 15 +++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.c-torture/execute/pr49186.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 20a3938ceaa..0e9738198f3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2011-05-30 Kaz Kojima + + 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 * 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 94c8ba4fb0a..fb204c648e9 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 d8b0ef5446d..d9bfc914011 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-05-30 Kaz Kojima + + PR target/49186 + * gcc.c-torture/execute/pr49186.c: New. + 2011-05-30 H.J. Lu 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 00000000000..743815b9802 --- /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; +} -- 2.30.2