This is the mail archive of the
mailing list for the GCC project.
Re: 3.0.1 Freeze
- To: Richard Henderson <rth at redhat dot com>
- Subject: Re: 3.0.1 Freeze
- From: Roman Zippel <zippel at linux-m68k dot org>
- Date: Wed, 8 Aug 2001 21:17:00 +0200 (CEST)
- cc: Mark Mitchell <mark at codesourcery dot com>, <gcc at gcc dot gnu dot org>
On Wed, 8 Aug 2001, Richard Henderson wrote:
> This patch looks like it "fixes" things by disabling the optimization.
> I think your earlier patch that looked at reg notes was more correct.
That change still missed other cases I tried. The basic problem is that
regmove_optimize doesn't handle multiple sets correctly. An input value
might be also used as unused output value and the tests there miss some
While thinking about it my patch might miss a correct optimization for
something like this:
(set (reg (1)) (... (reg (2) "0") ... (reg (1)) ...))
So the correct patch should possibly look like below, which also had the
advantage to handle multiple sets.
Should I test this version for the trunk and provide m68k only version of
the other patch for the branch?
RCS file: /cvs/gcc/egcs/gcc/regmove.c,v
retrieving revision 1.109
diff -u -r1.109 regmove.c
--- regmove.c 2001/07/26 15:23:07 1.109
+++ regmove.c 2001/08/08 18:48:14
@@ -1315,10 +1315,14 @@
- set = single_set (insn);
+ set = set_of (dst, insn);
if (! set)
+ /* src must not be the destination in another set. */
+ if (set_of (src, insn))
/* match_no/dst must be a write-only operand, and
operand_operand/src must be a read-only operand. */
if (match.use[op_no] != READ
@@ -1330,7 +1334,7 @@
/* Make sure match_no is the destination. */
- if (recog_data.operand[match_no] != SET_DEST (set))
+ if (GET_CODE (set) != SET || dst != SET_DEST (set))
if (REGNO (src) < FIRST_PSEUDO_REGISTER)