This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re-enable crossjumping before bb-reorder
- From: Jan Hubicka <jh at suse dot cz>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Jan Hubicka <jh at suse dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 2 May 2002 18:33:43 +0200
- Subject: Re-enable crossjumping before bb-reorder
- References: <20020427231505.GA15001@atrey.karlin.mff.cuni.cz> <20020429151942.D11370@redhat.com> <20020430160511.GK18000@atrey.karlin.mff.cuni.cz> <20020430163200.A3211@redhat.com> <20020501070806.GC21948@atrey.karlin.mff.cuni.cz> <20020501093122.A3948@redhat.com> <20020501194421.GD1512@atrey.karlin.mff.cuni.cz> <20020501135713.A4134@redhat.com> <20020501220959.GB10884@atrey.karlin.mff.cuni.cz> <20020501153524.A4237@redhat.com>
> > That brings me to the question what happends to your testcase if you
> > add some float there so crossjumping gets called from reg-stack?
>
> I didn't try.
Oops, reg-stack no longer calls crossjumping itself, instead relies on
the prebb-reorder crossjumping to cleanup.
Since it is not done, we lose quite a bit of code space in fp intensive
programs.
I am attaching the patch I would definitly like to see on the trunk/branch
after 3.1.0. I am not sure if it is good idea to risc the 3.1.0 change
at the moment.
The patch to disable crossjumping is also not safe when the tablejump
is killed for diferent purpose - dead code is eliminated for instance.
Thu May 2 18:21:51 CEST 2002 Jan Hubicka <jh@suse.cz>
* cfgrtl.c (try_redirect_by_replacing_jump): Do not kill computed jumps
post reload.
* toplev.c (rest_of_compilation): Revert Richard's patch.
Index: cfgrtl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cfgrtl.c,v
retrieving revision 1.40
diff -c -3 -p -r1.40 cfgrtl.c
*** cfgrtl.c 27 Apr 2002 06:41:38 -0000 1.40
--- cfgrtl.c 2 May 2002 16:21:47 -0000
*************** try_redirect_by_replacing_jump (e, targe
*** 713,719 ****
basic_block src = e->src;
rtx insn = src->end, kill_from;
edge tmp;
! rtx set;
int fallthru = 0;
/* Verify that all targets will be TARGET. */
--- 713,719 ----
basic_block src = e->src;
rtx insn = src->end, kill_from;
edge tmp;
! rtx set, table;
int fallthru = 0;
/* Verify that all targets will be TARGET. */
*************** try_redirect_by_replacing_jump (e, targe
*** 722,727 ****
--- 722,733 ----
break;
if (tmp || !onlyjump_p (insn))
+ return false;
+ if (reload_completed && JUMP_LABEL (insn)
+ && (table = NEXT_INSN (JUMP_LABEL (insn))) != NULL_RTX
+ && GET_CODE (table) == JUMP_INSN
+ && (GET_CODE (PATTERN (table)) == ADDR_VEC
+ || GET_CODE (PATTERN (table)) == ADDR_DIFF_VEC))
return false;
/* Avoid removing branch with side effects. */
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.618
diff -c -3 -p -r1.618 toplev.c
*** toplev.c 30 Apr 2002 23:13:34 -0000 1.618
--- toplev.c 2 May 2002 16:21:48 -0000
*************** rest_of_compilation (decl)
*** 3313,3319 ****
splitting possibly introduced more crossjumping oppurtuntities.
Except that we can't actually run crossjumping without running
another DCE pass, which we can't do after reg-stack. */
! cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK);
if (flag_reorder_blocks)
{
reorder_basic_blocks ();
--- 3313,3320 ----
splitting possibly introduced more crossjumping oppurtuntities.
Except that we can't actually run crossjumping without running
another DCE pass, which we can't do after reg-stack. */
! cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_POST_REGSTACK
! | (flag_crossjumping ? CLEANUP_CROSSJUMP : 0));
if (flag_reorder_blocks)
{
reorder_basic_blocks ();