This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: shorten branches versus reg-stack
> On Mon, Jun 04, 2001 at 05:13:12PM +0200, Jan Hubicka wrote:
> > - timevar_push (TV_SHORTEN_BRANCH);
> > - shorten_branches (get_insns ());
> > - timevar_pop (TV_SHORTEN_BRANCH);
> > + split_all_insns (0);
> [...]
> > + /* Shorten branches. */
> > + timevar_push (TV_SHORTEN_BRANCH);
> > + shorten_branches (get_insns ());
> > + timevar_pop (TV_SHORTEN_BRANCH);
>
> This isn't good enough. You need to remove the split_all_insns from
> within shorten_branches and do it unconditionally before regstack.
>
>
> r~
Wed Jun 6 14:59:00 CEST 2001 Jan Hubicka <jh@suse.cz>
* toplev.c (rest_of_compilation): Call split_all_insns
before reg-stack and shorten-branches. Do shorten-branches
after reg-stack.
* final.c (shorten_branches): Remove insn splitting code.
Index: toplev.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/toplev.c,v
retrieving revision 1.463
diff -c -3 -p -r1.463 toplev.c
*** toplev.c 2001/06/05 20:32:40 1.463
--- toplev.c 2001/06/06 12:57:03
*************** rest_of_compilation (decl)
*** 3685,3702 ****
}
#endif
- #ifndef STACK_REGS
- /* ??? Do this before shorten branches so that we aren't creating
- insns too late and fail sanity checks in final. */
- convert_to_eh_region_ranges ();
- #endif
-
- /* Shorten branches.
-
- Note this must run before reg-stack because of death note (ab)use
- in the ia32 backend. */
timevar_push (TV_SHORTEN_BRANCH);
! shorten_branches (get_insns ());
timevar_pop (TV_SHORTEN_BRANCH);
#ifdef STACK_REGS
--- 3685,3700 ----
}
#endif
timevar_push (TV_SHORTEN_BRANCH);
! if (0
! #ifdef HAVE_ATTR_length
! || 1
! #endif
! #ifdef STACK_REGS
! || 1
! #endif
! )
! split_all_insns (0);
timevar_pop (TV_SHORTEN_BRANCH);
#ifdef STACK_REGS
*************** rest_of_compilation (decl)
*** 3710,3717 ****
ggc_collect ();
- convert_to_eh_region_ranges ();
#endif
current_function_nothrow = nothrow_function_p ();
if (current_function_nothrow)
--- 3708,3724 ----
ggc_collect ();
#endif
+
+ convert_to_eh_region_ranges ();
+
+ /* Shorten branches.
+
+ Note this must run before reg-stack because of death note (ab)use
+ in the ia32 backend. */
+ timevar_push (TV_SHORTEN_BRANCH);
+ shorten_branches (get_insns ());
+ timevar_pop (TV_SHORTEN_BRANCH);
current_function_nothrow = nothrow_function_p ();
if (current_function_nothrow)
Index: final.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/final.c,v
retrieving revision 1.172
diff -c -3 -p -r1.172 final.c
*** final.c 2001/05/12 06:03:20 1.172
--- final.c 2001/06/06 12:49:43
*************** shorten_branches (first)
*** 960,985 ****
int uid;
rtx align_tab[MAX_CODE_ALIGN];
- /* In order to make sure that all instructions have valid length info,
- we must split them before we compute the address/length info. */
-
- for (insn = NEXT_INSN (first); insn; insn = NEXT_INSN (insn))
- if (INSN_P (insn))
- {
- rtx old = insn;
- /* Don't split the insn if it has been deleted. */
- if (! INSN_DELETED_P (old))
- insn = try_split (PATTERN (old), old, 1);
- /* When not optimizing, the old insn will be still left around
- with only the 'deleted' bit set. Transform it into a note
- to avoid confusion of subsequent processing. */
- if (INSN_DELETED_P (old))
- {
- PUT_CODE (old, NOTE);
- NOTE_LINE_NUMBER (old) = NOTE_INSN_DELETED;
- NOTE_SOURCE_FILE (old) = 0;
- }
- }
#endif
/* We must do some computations even when not actually shortening, in
--- 960,965 ----