This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Remove old code in the SPARC backend
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: ja2morri at csclub dot uwaterloo dot ca (James Morrison)
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 22 Mar 2004 09:40:46 +0100
- Subject: Re: [PATCH] Remove old code in the SPARC backend
- References: <20040321192859.B82B510AC12@perpugilliam.csclub.uwaterloo.ca>
> * config/sparc/sparc.c (fcc_reg_operand): Remove #if 0'd code.
This one corresponds to the "experiment" in gen_compare_reg. You can't
modify it without modifying gen_compare_reg and I'm not sure we should.
> (function_arg): Likewise.
Given that the #if 0'd code seems to be the safe one, while the #if 1'd is an
optimization that seems to rely on an unintended behaviour in expand_call, I
think we shouldn't remove it without further investigation.
> * config/sparc/sparc.md: Likewise
Bad ChangeLog entry. You must name the patterns.
> Index: config/sparc/sparc.md
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.md,v
> retrieving revision 1.199
> diff -u -p -r1.199 sparc.md
> --- config/sparc/sparc.md 26 Feb 2004 18:40:41 -0000 1.199
> +++ config/sparc/sparc.md 21 Mar 2004 19:19:39 -0000
> @@ -7362,17 +7362,7 @@
>
> fn_rtx = operands[0];
>
> - /* Count the number of parameter registers being used by this call.
> - if that argument is NULL, it means we are using them all, which
> - means 6 on the sparc. */
> -#if 0
> - if (operands[2])
> - nregs_rtx = GEN_INT (REGNO (operands[2]) - 8);
> - else
> - nregs_rtx = GEN_INT (6);
> -#else
> nregs_rtx = const0_rtx;
> -#endif
This one is OK, but it would be better to const-propagate nregs_rtx then.
> if (! TARGET_ARCH64 && INTVAL (operands[3]) != 0)
> emit_call_insn
> @@ -7389,15 +7379,6 @@
> gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, 15)))));
>
> finish_call:
> -#if 0
> - /* If this call wants a structure value,
> - emit an unimp insn to let the called function know about this. */
> - if (! TARGET_ARCH64 && INTVAL (operands[3]) > 0)
> - {
> - rtx insn = emit_insn (operands[3]);
> - SCHED_GROUP_P (insn) = 1;
> - }
> -#endif
This one is OK, but you should also remove
;; This pattern recognizes the "instruction" that appears in
;; a function call that wants a structure value,
;; to inform the called function if compiled with Sun CC.
;(define_insn "*unimp_insn"
; [(match_operand:SI 0 "immediate_operand" "")]
; "GET_CODE (operands[0]) == CONST_INT && INTVAL (operands[0]) > 0"
; "unimp\t%0"
; [(set_attr "type" "marker")])
just above then.
> @@ -7510,14 +7491,7 @@
>
> fn_rtx = operands[1];
>
> -#if 0
> - if (operands[3])
> - nregs_rtx = GEN_INT (REGNO (operands[3]) - 8);
> - else
> - nregs_rtx = GEN_INT (6);
> -#else
> nregs_rtx = const0_rtx;
> -#endif
>
> vec = gen_rtvec (2,
> gen_rtx_SET (VOIDmode, operands[0],
OK with const-prop too.
> @@ -7740,9 +7714,6 @@
> (match_operand:SI 3 "" "")]
> ""
> {
> -#if 0
> - rtx chain = operands[0];
> -#endif
> rtx lab = operands[1];
> rtx stack = operands[2];
> rtx fp = operands[3];
> @@ -7772,21 +7743,6 @@
> really needed. */
> /*emit_insn (gen_rtx_USE (VOIDmode, frame_pointer_rtx));*/
> emit_insn (gen_rtx_USE (VOIDmode, stack_pointer_rtx));
> -
> -#if 0
> - /* Return, restoring reg window and jumping to goto handler. */
> - if (TARGET_V9 && GET_CODE (chain) == CONST_INT
> - && ! (INTVAL (chain) & ~(HOST_WIDE_INT)0xffffffff))
> - {
> - emit_jump_insn (gen_goto_handler_and_restore_v9 (labreg,
> - static_chain_rtx,
> - chain));
> - emit_barrier ();
> - DONE;
> - }
> - /* Put in the static chain register the nonlocal label address. */
> - emit_move_insn (static_chain_rtx, chain);
> -#endif
>
> emit_insn (gen_rtx_USE (VOIDmode, static_chain_rtx));
> emit_jump_insn (gen_goto_handler_and_restore (labreg));
I'd rather keep this one.
Thanks for the cleanup!
--
Eric Botcazou