This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR optimization/11974 (bitop libcall ICEs on Alpha)
- From: Falk Hueffner <falk dot hueffner at student dot uni-tuebingen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: 06 Oct 2003 12:44:06 +0200
- Subject: [PATCH] Fix PR optimization/11974 (bitop libcall ICEs on Alpha)
Hi,
Here's what happens:
expand_unop in optabs.c sees it's an ffs, and hardcodes outmode SI.
emit_library_call_value however returns a DI mode value, since Alpha's
function_value says int returns are really DI. Then emit_libcall_block
gets called with target in SImode and value DImode, which passes it on
to emit_move_insn, which ICEs.
I'm not really sure how to fix it. I propose to promote the libcall
outmode according to the architecture's LIBCALL_VALUE. At least, that
works on Alpha and i386.
2003-10-06 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
PR optimization/11974
* optabs.c (expand_unop): Promote libcall outmode according to
hard_libcall_value.
--
Falk
--- gcc/gcc/optabs.c~ 2003-10-05 20:11:22.000000000 +0200
+++ gcc/gcc/optabs.c 2003-10-06 12:38:55.000000000 +0200
@@ -2639,7 +2639,8 @@
have them return something that isn't a double-word. */
if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab
|| unoptab == popcount_optab || unoptab == parity_optab)
- outmode = TYPE_MODE (integer_type_node);
+ outmode
+ = GET_MODE (hard_libcall_value (TYPE_MODE (integer_type_node)));
start_sequence ();