Kenneth Zadeck - re: (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

Kaz,

This patch is fine. This is after all, your port.

Kenny

The last one is for SH specific changes.

SH backend uses the old flow analysis stuff in sh_output_mi_thunk and it causes compile time errors in dataflow blanch. The appended patch simply disables them. The 2nd hunk of the patch below is to avoid moving pop insn for the link register to the outside of epilogue when -fomit-frame-pointer option is specified . It looks that more optimizations are done in dataflow branch for epilogue. Changing UNSPEC_EH_RETURN to UNSPECV_EH_RETURN and unspec to unspec_volatile in eh_return patterns in the last hunk of the patch are needed to prevent optimizing eh_return insns away in epilogue. The remained part of the patch is lengthy but mechanical. It adds new sibcall_value* patterns to generate (set return_reg (call ...)) insn instead (call ...) insn for sibcall_value. These new patterns are slightly modified versions of existing sibcall* patterns. Without it, df can't compute the correct use of return registers when sibcall occurs. The first hunk is to remove unneeded brackets.

With this patch and the other generic changes I've sent, dataflow-branch bootstrapped on sh4-unknown-linux-gnu and there are no real regressions compared with trunk.

Regards, kaz

* config/sh/sh.c (sh_expand_prologue): Remove unneeded brackets.
(sh_expand_epilogue): Add blockage insn when not
frame_pointer_needed.
(sh_output_mi_thunk): Don't use flow analysis here.
* config/sh/sh.md (UNSPEC_EH_RETURN): Remove.
(UNSPECV_EH_RETURN): New macro.
(sibcall_valuei): New.
(sibcall_valuei_pcrel, sibcall_value_pcrel): Likewise.
(sibcall_value_compact, sibcall_value_media): Likewise.
(sibcall_value): Use new sibcall_value* patterns.
(eh_set_ra_si): Use unspec_volatile and UNSPECV_EH_RETURN.
(eh_set_ra_di, eh_set_ra_di+1): Likewise.

diff -uprN ORIG/dataflow/gcc/config/sh/sh.c LOCAL/dataflow/gcc/config/sh/sh.c --- ORIG/dataflow/gcc/config/sh/sh.c 2007-01-24 09:06:27.000000000 +0900 +++ LOCAL/dataflow/gcc/config/sh/sh.c 2007-01-25 21:41:12.000000000 +0900 @@ -6181,7 +6181,7 @@ sh_expand_prologue (void) incoming-argument decoder and/or of the return trampoline from the GOT, so make sure the PIC register is preserved and initialized. */

if (TARGET_SHCOMPACT && (current_function_args_info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1))) @@ -6749,7 +6749,11 @@ sh_expand_epilogue (bool sibcall_p) { save_size = 0; if (TEST_HARD_REG_BIT (live_regs_mask, PR_REG)) - pop (PR_REG); + { + if (!frame_pointer_needed) + emit_insn (gen_blockage ()); + pop (PR_REG); + } for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) { int j = (FIRST_PSEUDO_REGISTER - 1) - i; @@ -10308,6 +10312,7 @@ sh_output_mi_thunk (FILE *file, tree thu insn_locators_initialize (); insns = get_insns ();

+#if 0 if (optimize > 0) { /* Initialize the bitmap obstacks. */ @@ -10334,6 +10339,14 @@ sh_output_mi_thunk (FILE *file, tree thu else if (flag_pic) split_all_insns_noflow (); } +#else

+#endif

sh_reorg ();

@@ -10345,6 +10358,7 @@ sh_output_mi_thunk (FILE *file, tree thu final (insns, file, 1); final_end_function ();

+#if 0 if (optimize > 0) { /* Release all memory allocated by df. */ @@ -10358,6 +10372,7 @@ sh_output_mi_thunk (FILE *file, tree thu bitmap_obstack_release (&reg_obstack); bitmap_obstack_release (NULL); } +#endif

reload_completed = 0; epilogue_completed = 0; diff -uprN ORIG/dataflow/gcc/config/sh/sh.md LOCAL/dataflow/gcc/config/sh/sh.md --- ORIG/dataflow/gcc/config/sh/sh.md 2007-01-24 09:06:27.000000000 +0900 +++ LOCAL/dataflow/gcc/config/sh/sh.md 2007-01-27 21:16:27.000000000 +0900 @@ -135,7 +135,6 @@ (UNSPEC_FSINA 16) (UNSPEC_NSB 17) (UNSPEC_ALLOCO 18)

;; ------------------------------------------------------------------------- @@ -8013,15 +8013,197 @@ label: DONE; }")

-(define_expand "sibcall_value"

@@ -9095,19 +9277,22 @@ mov.l\t1f,r0\n\ ;; until we know where it will be put in the stack frame.

(define_insn "eh_set_ra_si"

(define_insn "eh_set_ra_di"

(define_split


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