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]

Re: Don't mark operands of jump instructions available in gcse




On Mon, 13 Aug 2001, Geoffrey Keating wrote:

>
> This patch is being contributed mostly so it doesn't get lost.
> The original port was doing computation as part of a jump instruction,
> but it didn't work out because reload can't handle it.
>
> Anyway, gcse was also doing the wrong thing.  gcse should really
> use insert_insn_on_edge,
How was it doing hte wrong thing?
It does use insert_insn_on_edge.
Except in the abnormal edge case.
Though, it's using the wrong test.
It can't do it on abornmal critical edges.
simple abnormal edges should work just fine.
> but I'm told all of gcse will go away
> sometime to be replaced with SSA-based code, so this just works
> around the problem by not trying to use expressions that
> are part of a branch.
This is wrong.
Saying "it will go away at some point" is not a good reason to use a
fix that just papers over the problem, at least, on the mainline.
There is nothing wrong with marking things in jump instructions. If there
is a problem, it's in insertion.
Besides, remember that precompiled headers are supposed to be here at
some point, yet strangely, i have seen no submission whatsover other than the
creation of a branch with nothing done on it.

I.E. I'll believe it's going away when i see it.
> > Tested on
powerpc-eabisim. >
> --
> Geoff Keating <geoffk@redhat.com>
>
> ===File ~/patches/gcc-gcsejumpavail.patch===================
> 2001-08-13  Geoffrey Keating  <geoffk@redhat.com>
>
> 	* gcse.c (hash_scan_set): Expressions that are set as part of
> 	jump instructions are not available.
>
> Index: gcse.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/gcse.c,v
> retrieving revision 1.147
> diff -p -u -p -r1.147 gcse.c
> --- gcse.c	2001/08/12 23:40:50	1.147
> +++ gcse.c	2001/08/13 20:47:31
> @@ -2191,8 +2191,11 @@ hash_scan_set (pat, insn, set_p)
>  	     this insn.  */
>  	  int antic_p = oprs_anticipatable_p (src, insn) && single_set (insn);
>  	  /* An expression is not available if its operands are
> -	     subsequently modified, including this insn.  */
> -	  int avail_p = oprs_available_p (src, insn);
> +	     subsequently modified, including this insn.  It's also not
> +	     available if this is a branch, because we can't insert
> +	     a set after the branch.  */
> +	  int avail_p = (oprs_available_p (src, insn)
> +			 && ! JUMP_P (insn));
>
>  	  insert_expr_in_table (src, GET_MODE (dest), insn, antic_p, avail_p);
>  	}
> ============================================================
>


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