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  <ajit...@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;
 
-- 
1.8.5.3

Reply via email to