From: Michael Eager <eager@eagerm.com>
To: David Malcolm <dmalcolm@redhat.com>, gcc-patches@gcc.gnu.org
Cc: Ajit Agarwal <ajitkum@xilinx.com>, Michael Eager <eager@eagercon.com>
Subject: Re: [PATCH] microblaze.c: fix warnings
Date: Thu, 02 Jun 2016 15:43:00 -0000 [thread overview]
Message-ID: <575053F9.8000501@eagerm.com> (raw)
In-Reply-To: <1464811495-34767-1-git-send-email-dmalcolm@redhat.com>
OK to apply,
On 06/01/2016 01:04 PM, David Malcolm wrote:
> The two microblaze configurations in contrib/config-list.mk
> microblaze-elf
> microblaze-linux
> currently fail to build due to warnings:
> microblaze.c: In function 'void insert_wic_for_ilb_runout(rtx_insn*)':
> microblaze.c:3653:7: error: unused variable 'wic_addr1' [-Werror=unused-variable]
> int wic_addr1 = 128 * 4;
> ^~~~~~~~~
> microblaze.c: In function 'void insert_wic()':
> microblaze.c:3696:10: error: unused variable 'j' [-Werror=unused-variable]
> int i, j;
> ^
> microblaze.c: In function 'rtx_def* get_branch_target(rtx)':
> microblaze.c:3627:1: error: control reaches end of non-void function [-Werror=return-type]
> }
> ^
>
> (tested with compiling trunk using gcc 6).
>
> It looks like these warnings were introduced in this last commit to
> microblaze.c, r232683:
>
> 2016-01-21 Ajit Agarwal <ajitkum@xilinx.com>
>
> * config/microblaze/microblaze.c
> (get_branch_target): New.
> (insert_wic_for_ilb_runout): New.
> (insert_wic): New.
> (microblaze_machine_dependent_reorg): New.
> (TARGET_MACHINE_DEPENDENT_REORG): Define macro.
> * config/microblaze/microblaze.md
> (UNSPEC_IPREFETCH): Define.
> (iprefetch): New pattern
> * config/microblaze/microblaze.opt
> (mxl-prefetch): New flag.
>
> The attached patch fixes them.
>
> I picked NULL_RTX as a return value for get_branch_target; is this
> sane? The result is only ever assigned to the local "branch_target"
> here:
>
> 3732 if ((branch_target = get_branch_target (insn)))
>
> and that local appears to be unused otherwise.
>
> OK for trunk? (I've only verified that it compiles and fixes the
> warnings; I haven't tested the results).
>
> gcc/ChangeLog:
> * config/microblaze/microblaze.c (get_branch_target): Add return
> NULL_RTX for the non-CALL_P case.
> (insert_wic_for_ilb_runout): Remove unused local "wic_addr1".
> (insert_wic): Remove unused local "j".
> ---
> gcc/config/microblaze/microblaze.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/microblaze/microblaze.c b/gcc/config/microblaze/microblaze.c
> index baff67a..8f4768e 100644
> --- a/gcc/config/microblaze/microblaze.c
> +++ b/gcc/config/microblaze/microblaze.c
> @@ -3624,6 +3624,8 @@ get_branch_target (rtx branch)
> abort ();
> return XEXP (XEXP (call, 0), 0);
> }
> +
> + return NULL_RTX;
> }
>
> /* Heuristics to identify where to insert at the
> @@ -3650,7 +3652,6 @@ insert_wic_for_ilb_runout (rtx_insn *first)
> int addr_offset = 0;
> int length;
> int wic_addr0 = 128 * 4;
> - int wic_addr1 = 128 * 4;
>
> int first_addr = INSN_ADDRESSES (INSN_UID (first));
>
> @@ -3693,7 +3694,7 @@ static void
> insert_wic (void)
> {
> rtx_insn *insn;
> - int i, j;
> + int i;
> basic_block bb, prev = 0;
> rtx branch_target = 0;
>
>
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
prev parent reply other threads:[~2016-06-02 15:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 19:39 David Malcolm
2016-06-02 15:43 ` Michael Eager [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=575053F9.8000501@eagerm.com \
--to=eager@eagerm.com \
--cc=ajitkum@xilinx.com \
--cc=dmalcolm@redhat.com \
--cc=eager@eagercon.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).