From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24681 invoked by alias); 5 Apr 2011 17:55:54 -0000 Received: (qmail 24670 invoked by uid 22791); 5 Apr 2011 17:55:53 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Apr 2011 17:55:49 +0000 Received: (qmail 5006 invoked from network); 5 Apr 2011 17:55:47 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 Apr 2011 17:55:47 -0000 Date: Tue, 05 Apr 2011 17:55:00 -0000 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Cc: rth@redhat.com, ebotcazou@libertysurf.fr, sterling@tensilica.com Subject: [PATCH] use use_reg in several backends Message-ID: <20110405175542.GB27880@nightcrawler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00382.txt.bz2 Several places in the compiler could be usefully modified to use use_reg instead of hand-building EXPR_LISTs. This patch makes such changes. Since this patch implements equivalent functionality with an existing function call, I believe it counts as obvious. Tested by building cc1 for appropriate targets. Will commit in a day or two after giving maintainers a chance for comments. -Nathan * config/alpha/alpha.c (alpha_emit_xfloating_libcall): Call use_reg. * config/xtensa/xtensa.c (xtensa_call_tls_desc): Likewise. * config/sparc/sparc.c (sparc_legitimize_tls_address): Likewise. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 8aabeb2..d34042e 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -2999,7 +2999,7 @@ alpha_emit_xfloating_libcall (rtx func, rtx target, rtx operands[], } emit_move_insn (reg, operands[i]); - usage = alloc_EXPR_LIST (0, gen_rtx_USE (VOIDmode, reg), usage); + use_reg (&usage, reg); } switch (GET_MODE (target)) diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 5623cc1..fe70270 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -1872,9 +1872,7 @@ xtensa_call_tls_desc (rtx sym, rtx *retp) emit_insn (gen_tls_arg (arg, sym)); emit_move_insn (a10, arg); call_insn = emit_call_insn (gen_tls_call (a10, fn, sym, const1_rtx)); - CALL_INSN_FUNCTION_USAGE (call_insn) - = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, a10), - CALL_INSN_FUNCTION_USAGE (call_insn)); + use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), a10); insns = get_insns (); end_sequence (); diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 1e7ce53..ecb4d25 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -3308,9 +3308,7 @@ sparc_legitimize_tls_address (rtx addr) insn = emit_call_insn (gen_tgd_call64 (o0, sparc_tls_get_addr (), addr, const1_rtx)); } - CALL_INSN_FUNCTION_USAGE (insn) - = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, o0), - CALL_INSN_FUNCTION_USAGE (insn)); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), o0); insn = get_insns (); end_sequence (); emit_libcall_block (insn, ret, o0, addr); @@ -3338,9 +3336,7 @@ sparc_legitimize_tls_address (rtx addr) insn = emit_call_insn (gen_tldm_call64 (o0, sparc_tls_get_addr (), const1_rtx)); } - CALL_INSN_FUNCTION_USAGE (insn) - = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, o0), - CALL_INSN_FUNCTION_USAGE (insn)); + use_reg (&CALL_INSN_FUNCTION_USAGE (insn), o0); insn = get_insns (); end_sequence (); emit_libcall_block (insn, temp3, o0,