This is the mail archive of the
mailing list for the GCC project.
Re: [Committed] ifcvt.c solution to PR9814
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 28 May 2005 12:03:11 -0600 (MDT)
- Subject: Re: [Committed] ifcvt.c solution to PR9814
On Fri, 27 May 2005, Richard Henderson wrote:
> I have two problems with this patch. First,
> > ! insn = emit_move_insn (x, y);
> Passing IOR as a RHS argument to emit_move_insn is wrong. This
> function does not handle arbitrary expressions, only "operands".
> Think of that as general_operand, only with memories with invalid
> addresses and invalid constants.
> If you want to emit a set and check to see if it's recognizable,
> then do that, i.e. emit_insn (gen_rtx_SET (VOIDmode, x, y)).
The following patch address the first (and easiest to resolve) of
these issues, using the implementation you propose. The second is
trickier, and may require a reorganization/API change. If I can't
figure out a way to address it, we might have to revert thst part
of the patch, and hope this optimization gets implemented at the
The following patch has been tested on i686-pc-linux-gnu with a full
"make bootstrap", all default languages, and regression tested with a
top-level "make -k check" with no new failures.
Ok for mainline?
2005-05-28 Roger Sayle <firstname.lastname@example.org>
Richard Henderson <email@example.com>
* ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly
instead of calling emit_move_insn with an arbitrary RHS.
RCS file: /cvs/gcc/gcc/gcc/ifcvt.c,v
retrieving revision 1.188
diff -c -3 -p -r1.188 ifcvt.c
*** ifcvt.c 27 May 2005 02:45:55 -0000 1.188
--- ifcvt.c 28 May 2005 00:13:29 -0000
*************** noce_emit_move_insn (rtx x, rtx y)
*** 691,697 ****
! insn = emit_move_insn (x, y);
seq = get_insns ();
--- 691,700 ----
! /* It's not generally safe to call emit_move_insn, even when
! the RHS is known to be the SET_DEST of a valid pattern.
! Instead construct the SET pattern explicitly. */
! insn = emit_insn (gen_rtx_SET (VOIDmode, x, y));
seq = get_insns ();