diff options
author | Michael Meissner <meissner@linux.vnet.ibm.com> | 2012-06-05 19:40:34 +0000 |
---|---|---|
committer | Michael Meissner <meissner@gcc.gnu.org> | 2012-06-05 19:40:34 +0000 |
commit | d7685183c11486a86721e03c8b3b64fcfd44f0cc (patch) | |
tree | 2965431741fdd7023479a8b0d618d9a1b0d848e3 /gcc/config | |
parent | 951c68fac82a2980b1b703c9daad8f0560daabd1 (diff) | |
download | gcc-d7685183c11486a86721e03c8b3b64fcfd44f0cc.zip gcc-d7685183c11486a86721e03c8b3b64fcfd44f0cc.tar.gz gcc-d7685183c11486a86721e03c8b3b64fcfd44f0cc.tar.bz2 |
re PR target/53487 (Unrecognizable insn for conditional move)
[gcc]
2012-06-04 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/53487
* config/rs6000/rs6000.c (rs6000_generate_compare): If we are
doing an unsigned compare, make sure the second argument is not a
negative constant.
(rs6000_emit_cmove): Don't allow floating point comparisons when
generating ISEL moves.
[gcc/testsuite]
2012-06-04 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/pr53487.c: New test.
From-SVN: r188248
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/rs6000/rs6000.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index ffb0023..11c4bf7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -15419,6 +15419,16 @@ rs6000_generate_compare (rtx cmp, enum machine_mode mode) else comp_mode = CCmode; + /* If we have an unsigned compare, make sure we don't have a signed value as + an immediate. */ + if (comp_mode == CCUNSmode && GET_CODE (op1) == CONST_INT + && INTVAL (op1) < 0) + { + op0 = copy_rtx_if_shared (op0); + op1 = force_reg (GET_MODE (op0), op1); + cmp = gen_rtx_fmt_ee (code, GET_MODE (cmp), op0, op1); + } + /* First, the compare. */ compare_result = gen_reg_rtx (comp_mode); @@ -16172,6 +16182,11 @@ rs6000_emit_cmove (rtx dest, rtx op, rtx true_cond, rtx false_cond) if (GET_MODE (false_cond) != result_mode) return 0; + /* Don't allow using floating point comparisons for integer results for + now. */ + if (FLOAT_MODE_P (compare_mode) && !FLOAT_MODE_P (result_mode)) + return 0; + /* First, work out if the hardware can do this at all, or if it's too slow.... */ if (!FLOAT_MODE_P (compare_mode)) |