This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
tree level.


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  <roger@eyesopen.com>
	    Richard Henderson  <rth@redhat.com>

	* ifcvt.c (noce_emit_move_insn): Construct a SET pattern directly
	instead of calling emit_move_insn with an arbitrary RHS.


Index: ifcvt.c
===================================================================
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 ****
        optab ot;

        start_sequence ();
!       insn = emit_move_insn (x, y);
        seq = get_insns ();
        end_sequence();

--- 691,700 ----
        optab ot;

        start_sequence ();
!       /* 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 ();
        end_sequence();


Roger
--


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]