This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] more simplify_subreg SIMD bugs
On Sat, Jun 14, 2003 at 07:18:18AM -0400, Aldy Hernandez wrote:
> ...and if you see the logic in simplify_subreg(), you'll see insn 37
> eventually being turned into:
>
> (insn 37 7 38 0 0x1230dc0 (set (reg:V2SF 141 [ a ])
> (const_vector:V2SF [
> (const_double:SF 0.0 [0x0.0p+0])
> (const_double:SF 0.0 [0x0.0p+0])
> ])) 983 {*movv2sf_internal} (nil)
As discussed on irc, I think the proper solution is as follows.
r~
Index: simplify-rtx.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/simplify-rtx.c,v
retrieving revision 1.142
diff -c -p -d -u -r1.142 simplify-rtx.c
--- simplify-rtx.c 13 Jun 2003 19:27:27 -0000 1.142
+++ simplify-rtx.c 16 Jun 2003 20:38:29 -0000
@@ -2721,7 +2721,7 @@ simplify_subreg (outermode, op, innermod
/* This might fail, e.g. if taking a subreg from a SYMBOL_REF. */
/* ??? It would be nice if we could actually make such subregs
on targets that allow such relocations. */
- if (byte >= GET_MODE_UNIT_SIZE (innermode))
+ if (byte >= GET_MODE_SIZE (innermode))
elt = CONST0_RTX (submode);
else
elt = simplify_subreg (submode, op, innermode, byte);