This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to combine.c for simd-5 failures
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 24 Sep 2003 21:09:48 +0100
- Subject: Patch to combine.c for simd-5 failures
This patch fixes some compile/simd-5 failures on mips targets.
The problem was that combine.c:if_then_else_cond() was trying to
do the following for vector modes:
/* If X is known to be either 0 or -1, those are the true and
false values when testing X. */
[...]
/* Likewise for 0 or a single bit. */
else if (mode != VOIDmode
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& exact_log2 (nz = nonzero_bits (x, mode)) >= 0)
{
*ptrue = gen_int_mode (nz, mode), *pfalse = const0_rtx;
return x;
}
and we'd then abort in trunc_int_for_mode.
Tested on i686-pc-linux-gnu, mips-sgi-irix6.5{,32} & other mips targets.
OK to install?
Richard
* combine.c (if_then_else_cond): Tighten mode check.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.387
diff -u -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.387 combine.c
--- combine.c 14 Sep 2003 18:31:13 -0000 1.387
+++ combine.c 21 Sep 2003 15:04:54 -0000
@@ -7422,7 +7422,7 @@ if_then_else_cond (rtx x, rtx *ptrue, rt
}
/* Likewise for 0 or a single bit. */
- else if (mode != VOIDmode
+ else if (SCALAR_INT_MODE_P (mode)
&& GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
&& exact_log2 (nz = nonzero_bits (x, mode)) >= 0)
{