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: fix tablejump elimination wrt crossjumping


> Following
> 
> Fri May  3 11:12:24 CEST 2002  Jan Hubicka  <jh at suse dot cz>
> 
> 	* cfgcleanup.c (try_optimize_cfg):  Call merge_block only when
> 	jump is simplejump.
> 
> Thu May  2 19:50:04 CEST 2002  Jan Hubicka  <jh at suse dot cz>
> 
>         * cfgrtl.c (try_redirect_by_replacing_jump): Do not kill computed
>         jumps post reload.
>         * toplev.c (rest_of_compilation): Revert Richard's patch.
> 
> we lost all ability to eliminate tablejump insns after reload.

I was aware of that but didn't find any other sollution, unforutnately..
> 
> Index: cfgcleanup.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cfgcleanup.c,v
> retrieving revision 1.79
> diff -u -p -u -r1.79 cfgcleanup.c
> --- cfgcleanup.c	23 Mar 2003 01:40:04 -0000	1.79
> +++ cfgcleanup.c	23 Mar 2003 20:38:16 -0000
> @@ -1791,7 +1791,9 @@ try_optimize_cfg (mode)
>  		  /* If the jump insn has side effects,
>  		     we can't kill the edge.  */
>  		  && (GET_CODE (b->end) != JUMP_INSN
> -		      || simplejump_p (b->end))
> +		      || (flow2_completed
> +			  ? simplejump_p (b->end)
> +			  : onlyjump_p (b->end)))

I don't think this is safe - it is possible that the computation
temporary has been spilled to the stack and we don't DCE dead stores
reliably.

Honza
>  		  && (next = merge_blocks (s, b, c, mode)))
>  	        {
>  		  b = next;
> Index: cfgrtl.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cfgrtl.c,v
> retrieving revision 1.67
> diff -u -p -u -r1.67 cfgrtl.c
> --- cfgrtl.c	5 Mar 2003 22:05:18 -0000	1.67
> +++ cfgrtl.c	23 Mar 2003 20:38:16 -0000
> @@ -684,7 +684,7 @@ try_redirect_by_replacing_jump (e, targe
>  
>    if (tmp || !onlyjump_p (insn))
>      return false;
> -  if (reload_completed && JUMP_LABEL (insn)
> +  if (flow2_completed && JUMP_LABEL (insn)
>        && (table = NEXT_INSN (JUMP_LABEL (insn))) != NULL_RTX
>        && GET_CODE (table) == JUMP_INSN
>        && (GET_CODE (PATTERN (table)) == ADDR_VEC


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