This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix for recent execute/950607-2.c regression on ppc-eabi
- From: Geoff Keating <geoffk at geoffk dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Andrew MacLeod <amacleod at redhat dot com>
- Date: Fri, 28 Dec 2001 00:55:46 -0800
- Subject: fix for recent execute/950607-2.c regression on ppc-eabi
- Reply-to: Geoff Keating <geoffk at redhat dot com>
This fixes the recent execute/950607-2.c failure introduced by
2001-12-06 Andrew MacLeod <amacleod@redhat.com>
* flow.c (find_regno_partial): Return register, not the expression
the register is in.
which I think just enabled an optimisation which turned out to be
buggy.
Combine was taking
(insn 20 16 24 (set (subreg:SI (reg/v/j:DI 117) 0)
(const_int 23250 [0x5ad2])) 294 {*movsi_internal1} (insn_list
84 (nil))
(nil))
(insn 24 20 28 (set (subreg:SI (reg/v/j:DI 117) 4)
(const_int -23250 [0xffffffffffffa52e])) 294
{*movsi_internal1} (insn_list 20 (nil))
(nil))
and producing
(insn 24 20 28 (set (reg/v/j:DI 117)
(const_int -23250 [0xffffffffffffa52e])) 313
{*movdi_internal32} (nil)
(nil))
when it should have been more like 0x00005ad2ffffa52e instead.
Bootstrapped & tested on powerpc-linux.
--
- Geoffrey Keating <geoffk@geoffk.org> <geoffk@redhat.com>
===File ~/patches/cygnus/gcc-combinesubregsign.patch========
2001-12-27 Geoff Keating <geoffk@redhat.com>
* combine.c (try_combine): Mask off sign bits when combining
stores to the low and high parts of a two-word value.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.248
diff -p -u -u -p -r1.248 combine.c
--- combine.c 2001/12/21 11:07:59 1.248
+++ combine.c 2001/12/28 07:31:01
@@ -1650,7 +1650,8 @@ try_combine (i3, i2, i1, new_direct_jump
abort ();
lo &= ~(UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1);
- lo |= INTVAL (SET_SRC (PATTERN (i3)));
+ lo |= (INTVAL (SET_SRC (PATTERN (i3)))
+ & (UWIDE_SHIFT_LEFT_BY_BITS_PER_WORD (1) - 1));
}
else if (HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
hi = INTVAL (SET_SRC (PATTERN (i3)));
============================================================