This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] fix REG_EQUAL note for UNSIGNED_FLOAT libcall
- From: Bob Wilson <bwilson at tensilica dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 24 Apr 2008 15:05:30 -0700
- Subject: [PATCH] fix REG_EQUAL note for UNSIGNED_FLOAT libcall
The EQUIV parameter to emit_libcall_block when expanding an unsigned-to-float
conversion is wrong. It is always a FLOAT operation, regardless of whether the
source is signed or not. I discovered this for an Xtensa target with GCC 4.2.0,
but I cannot reproduce that particular problem with the current trunk (i.e., the
REG_EQUAL note is still incorrect but it doesn't lead to incorrect code as it
did with 4.2.0). Since the fix is simple and the problem seems obvious, I'm
submitting the patch even though I don't have a testcase for the problem.
I've tested this with an xtensa-elf build and an i686-pc-linux-gnu bootstrap.
Neither had any regressions for the C and C++ testsuites.
Is this OK?
2008-04-24 Bob Wilson <bob.wilson@acm.org>
* optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall.
Index: optabs.c
===================================================================
--- optabs.c (revision 134642)
+++ optabs.c (working copy)
@@ -5270,7 +5270,8 @@
end_sequence ();
emit_libcall_block (insns, target, value,
- gen_rtx_FLOAT (GET_MODE (to), from));
+ gen_rtx_fmt_e (unsignedp ? UNSIGNED_FLOAT : FLOAT,
+ GET_MODE (to), from));
}
done: