Patchwork RFA: Fix score --enable-werror-always build

login
register
mail settings
Submitter Joern Rennecke
Date Nov. 9, 2010, 9:29 p.m.
Message ID <20101109162906.yx7f1174lc088s48-nzlynne@webmail.spamcop.net>
Download mbox | patch
Permalink /patch/70577/
State New
Headers show

Comments

Joern Rennecke - Nov. 9, 2010, 9:29 p.m.
Built on i686-pc-linux-gnu with gcc (GCC) 4.6.0 20101103 (experimental) .
2010-11-09  Joern Rennecke  <amylaar@spamcop.net>

	PR target/44762
	* config/score/score3.c (score3_return_in_memory): Constify arguments.
	(score3_in_small_data_p, score3_function_value): Likewise.
	(score3_trampoline_init): Use LCT_NORMAL.
	(score3_print_operand): Initialize code as UNKNOWN.
	* config/score/predicates.md (score_load_multiple_operation):
	Remove unused variable.
	(score_store_multiple_operation): Likewise.
	* config/score/score7.c (score7_return_in_memory): Constify arguments.
        (score7_in_small_data_p, score7_function_value): Likewise.
	(score7_trampoline_init): Use LCT_NORMAL.
	(score7_print_operand): Initialize code as UNKNOWN.
	* config/score/score3.h (score3_return_in_memory): Update prototype.
	(score3_in_small_data_p, score3_function_value): Likewise.
	* config/score/score-protos.h (score_function_value): Likewise.
	* config/score/score7.h (score7_return_in_memory): Update prototype.
	(score7_in_small_data_p, score7_function_value): Likewise.
	* config/score/score.c (TARGET_PROMOTE_PROTOTYPES): Constify.
	(score_return_in_memory, score_pass_by_reference): Constify arguments.
	(score_output_mi_thunk, score_function_prologue): Don't return a value.
	(score_function_epilogue, score_in_small_data_p): Likewise.
	(score_option_override, score_asm_trampoline_template): Likewise.
	(score_trampoline_init, score_print_operand): Likewise.
	(score_print_operand_address, score_prologue): Likewise.
	(score_epilogue, score_call, score_call_value): Likewise.
	(score_movsicc, score_movdi, score_zero_extract_andi): Likewise.
	(score_function_arg_advance): Likewise. Make static.
	(score_asm_file_end): Mark parameter value with ATTRIBUTE_UNUSED.
	(score_function_arg, score_legitimate_address_p): Make static.
	(score_function_value): Mark parameter func with ATTRIBUTE_UNUSED.
	* config/score/score.h (REGNO_REG_CLASS): Cast value to enum reg_class.
	* config/score/score-conv.h (UIMM_IN_RANGE, SIMM_IN_RANGE):
	Allow (W) == HOST_BITS_PER_WIDE_INT.
Joern Rennecke - Nov. 16, 2010, 2:45 p.m.
This patch is still unreviewed:
http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00952.html

I wonder what the general status of this port is.  It has no one listed
specifically in MAINTAINERS, and the only test results for score that a
search on the gcc-testresults list found was from early 2008:
http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg00709.html
Richard Henderson - Nov. 16, 2010, 4:07 p.m.
On 11/16/2010 06:45 AM, Joern Rennecke wrote:
> This patch is still unreviewed:
> http://gcc.gnu.org/ml/gcc-patches/2010-11/msg00952.html

Ok.


r~

Patch

Index: config/score/score3.c
===================================================================
--- config/score/score3.c	(revision 166491)
+++ config/score/score3.c	(working copy)
@@ -291,7 +291,7 @@  score3_classify_address (struct score3_a
 }
 
 bool
-score3_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
+score3_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
 {
     return ((TYPE_MODE (type) == BLKmode)
             || (int_size_in_bytes (type) > 2 * UNITS_PER_WORD)
@@ -576,7 +576,7 @@  score3_select_rtx_section (enum machine_
 
 /* Implement TARGET_IN_SMALL_DATA_P.  */
 bool
-score3_in_small_data_p (tree decl)
+score3_in_small_data_p (const_tree decl)
 {
   HOST_WIDE_INT size;
 
@@ -860,7 +860,8 @@  score3_function_arg (const CUMULATIVE_AR
    VALTYPE is the return type and MODE is VOIDmode.  For libcalls,
    VALTYPE is null and MODE is the mode of the return value.  */
 rtx
-score3_function_value (tree valtype, tree func, enum machine_mode mode)
+score3_function_value (const_tree valtype, const_tree func,
+		       enum machine_mode mode)
 {
   if (valtype)
     {
@@ -912,7 +913,7 @@  score3_trampoline_init (rtx m_tramp, tre
   emit_move_insn (mem, chain_value);
 
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE),
-                     0, VOIDmode, 2,
+                     LCT_NORMAL, VOIDmode, 2,
                      addr, Pmode,
                      GEN_INT (TRAMPOLINE_SIZE), SImode);
 #undef FFCACHE
@@ -1224,7 +1225,7 @@  score3_return_addr (int count, rtx frame
 void
 score3_print_operand (FILE *file, rtx op, int c)
 {
-  enum rtx_code code = -1;
+  enum rtx_code code = UNKNOWN;
   if (!PRINT_OPERAND_PUNCT_VALID_P (c))
     code = GET_CODE (op);
 
Index: config/score/predicates.md
===================================================================
--- config/score/predicates.md	(revision 166491)
+++ config/score/predicates.md	(working copy)
@@ -89,7 +89,6 @@  (define_predicate "score_load_multiple_o
 {
   int count = XVECLEN (op, 0);
   int dest_regno;
-  rtx src_addr;
   int i;
 
   /* Perform a quick check so we don't blow up below.  */
@@ -100,7 +99,6 @@  (define_predicate "score_load_multiple_o
     return 0;
 
   dest_regno = REGNO (SET_DEST (XVECEXP (op, 0, 0)));
-  src_addr = XEXP (SET_SRC (XVECEXP (op, 0, 0)), 0);
 
   for (i = 1; i < count; i++)
     {
@@ -124,7 +122,6 @@  (define_predicate "score_store_multiple_
 {
   int count = XVECLEN (op, 0);
   int src_regno;
-  rtx dest_addr;
   int i;
 
   /* Perform a quick check so we don't blow up below.  */
@@ -135,7 +132,6 @@  (define_predicate "score_store_multiple_
     return 0;
 
   src_regno = REGNO (SET_SRC (XVECEXP (op, 0, 0)));
-  dest_addr = XEXP (SET_DEST (XVECEXP (op, 0, 0)), 0);
 
   for (i = 1; i < count; i++)
     {
Index: config/score/score7.c
===================================================================
--- config/score/score7.c	(revision 166491)
+++ config/score/score7.c	(working copy)
@@ -290,7 +290,7 @@  score7_classify_address (struct score7_a
 }
 
 bool
-score7_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
+score7_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
 {
     return ((TYPE_MODE (type) == BLKmode)
             || (int_size_in_bytes (type) > 2 * UNITS_PER_WORD)
@@ -575,7 +575,7 @@  score7_select_rtx_section (enum machine_
 
 /* Implement TARGET_IN_SMALL_DATA_P.  */
 bool
-score7_in_small_data_p (tree decl)
+score7_in_small_data_p (const_tree decl)
 {
   HOST_WIDE_INT size;
 
@@ -851,7 +851,8 @@  score7_function_arg (const CUMULATIVE_AR
    VALTYPE is the return type and MODE is VOIDmode.  For libcalls,
    VALTYPE is null and MODE is the mode of the return value.  */
 rtx
-score7_function_value (tree valtype, tree func, enum machine_mode mode)
+score7_function_value (const_tree valtype, const_tree func,
+		       enum machine_mode mode)
 {
   if (valtype)
     {
@@ -900,7 +901,7 @@  score7_trampoline_init (rtx m_tramp, tre
   emit_move_insn (mem, chain_value);
 
   emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE),
-                     0, VOIDmode, 2,
+                     LCT_NORMAL, VOIDmode, 2,
                      addr, Pmode,
                      GEN_INT (TRAMPOLINE_SIZE), SImode);
 #undef FFCACHE
@@ -1212,7 +1213,7 @@  score7_return_addr (int count, rtx frame
 void
 score7_print_operand (FILE *file, rtx op, int c)
 {
-  enum rtx_code code = -1;
+  enum rtx_code code = UNKNOWN;
   if (!PRINT_OPERAND_PUNCT_VALID_P (c))
     code = GET_CODE (op);
 
Index: config/score/score3.h
===================================================================
--- config/score/score3.h	(revision 166491)
+++ config/score/score3.h	(working copy)
@@ -71,8 +71,8 @@  struct score3_address_info
 
 extern int score3_symbolic_constant_p (rtx x,
                                        enum score_symbol_type *symbol_type);
-extern bool score3_return_in_memory (tree type,
-                                     tree fndecl ATTRIBUTE_UNUSED);
+extern bool score3_return_in_memory (const_tree type,
+                                     const_tree fndecl ATTRIBUTE_UNUSED);
 extern void score3_output_mi_thunk (FILE *file,
                                     tree thunk_fndecl ATTRIBUTE_UNUSED,
                                     HOST_WIDE_INT delta,
@@ -87,7 +87,7 @@  score3_function_epilogue (FILE *file,
                           HOST_WIDE_INT size ATTRIBUTE_UNUSED);
 extern section *score3_select_rtx_section (enum machine_mode mode, rtx x,
                                            unsigned HOST_WIDE_INT align);
-extern bool score3_in_small_data_p (tree decl);
+extern bool score3_in_small_data_p (const_tree decl);
 extern void score3_asm_file_start (void);
 extern void score3_asm_file_end (void);
 extern void score3_option_override (void);
@@ -117,8 +117,8 @@  extern rtx score3_function_arg (const CU
                                 enum machine_mode mode,
                                 const_tree type,
                                 bool named);
-extern rtx score3_function_value (tree valtype,
-                                  tree func ATTRIBUTE_UNUSED,
+extern rtx score3_function_value (const_tree valtype,
+                                  const_tree func ATTRIBUTE_UNUSED,
                                   enum machine_mode mode);
 extern void score3_asm_trampoline_template (FILE *);
 extern void score3_trampoline_init (rtx, tree, rtx);
Index: config/score/score-protos.h
===================================================================
--- config/score/score-protos.h	(revision 166491)
+++ config/score/score-protos.h	(working copy)
@@ -56,7 +56,7 @@  extern int score_output_external (FILE *
 extern enum reg_class score_secondary_reload_class (enum reg_class rclass,
                                                     enum machine_mode mode,
                                                     rtx x);
-extern rtx score_function_value (tree valtype, tree func,
+extern rtx score_function_value (const_tree valtype, const_tree func,
                                  enum machine_mode mode);
 extern enum reg_class score_preferred_reload_class (rtx x,
                                                     enum reg_class rclass);
Index: config/score/score7.h
===================================================================
--- config/score/score7.h	(revision 166491)
+++ config/score/score7.h	(working copy)
@@ -71,8 +71,8 @@  struct score7_address_info
 
 extern int score7_symbolic_constant_p (rtx x,
                                        enum score_symbol_type *symbol_type);
-extern bool score7_return_in_memory (tree type,
-                                     tree fndecl ATTRIBUTE_UNUSED);
+extern bool score7_return_in_memory (const_tree type,
+                                     const_tree fndecl ATTRIBUTE_UNUSED);
 extern void score7_output_mi_thunk (FILE *file,
                                     tree thunk_fndecl ATTRIBUTE_UNUSED,
                                     HOST_WIDE_INT delta,
@@ -87,7 +87,7 @@  score7_function_epilogue (FILE *file,
                           HOST_WIDE_INT size ATTRIBUTE_UNUSED);
 extern section *score7_select_rtx_section (enum machine_mode mode, rtx x,
                                            unsigned HOST_WIDE_INT align);
-extern bool score7_in_small_data_p (tree decl);
+extern bool score7_in_small_data_p (const_tree decl);
 extern void score7_asm_file_start (void);
 extern void score7_asm_file_end (void);
 extern void score7_option_override (void);
@@ -117,8 +117,8 @@  extern rtx score7_function_arg (const CU
                                 enum machine_mode mode,
                                 const_tree type,
                                 bool named);
-extern rtx score7_function_value (tree valtype,
-                                  tree func ATTRIBUTE_UNUSED,
+extern rtx score7_function_value (const_tree valtype,
+                                  const_tree func ATTRIBUTE_UNUSED,
                                   enum machine_mode mode);
 extern void score7_asm_trampoline_template (FILE *);
 extern void score7_trampoline_init (rtx, tree, rtx);
Index: config/score/score.c
===================================================================
--- config/score/score.c	(revision 166491)
+++ config/score/score.c	(working copy)
@@ -106,7 +106,7 @@  static const struct default_options scor
 #define TARGET_PROMOTE_FUNCTION_MODE    default_promote_function_mode_always_promote
 
 #undef TARGET_PROMOTE_PROTOTYPES
-#define TARGET_PROMOTE_PROTOTYPES       hook_bool_tree_true
+#define TARGET_PROMOTE_PROTOTYPES       hook_bool_const_tree_true
 
 #undef TARGET_MUST_PASS_IN_STACK
 #define TARGET_MUST_PASS_IN_STACK       must_pass_in_stack_var_size
@@ -152,7 +152,7 @@  enum reg_class score_char_to_class[256];
    small structures are returned in a register.
    Objects with varying size must still be returned in memory.  */
 static bool
-score_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED)
+score_return_in_memory (const_tree type, const_tree fndecl ATTRIBUTE_UNUSED)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
     return score7_return_in_memory (type, fndecl);
@@ -165,7 +165,7 @@  score_return_in_memory (tree type, tree 
 /* Return nonzero when an argument must be passed by reference.  */
 static bool
 score_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
-                         enum machine_mode mode, tree type,
+                         enum machine_mode mode, const_tree type,
                          bool named ATTRIBUTE_UNUSED)
 {
   /* If we have a variable-sized parameter, we have no choice.  */
@@ -180,12 +180,11 @@  score_output_mi_thunk (FILE *file, tree 
                        tree function)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_output_mi_thunk (file, thunk_fndecl, delta,
-                                   vcall_offset, function);
+    score7_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function);
   else if (TARGET_SCORE3)
-    return score3_output_mi_thunk (file, thunk_fndecl, delta,
-                                   vcall_offset, function);
-  gcc_unreachable ();
+    score3_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement TARGET_FUNCTION_OK_FOR_SIBCALL.  */
@@ -201,11 +200,11 @@  static void
 score_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_function_prologue (file, size);
+    score7_function_prologue (file, size);
   else if (TARGET_SCORE3)
-    return score3_function_prologue (file, size);
-
-  gcc_unreachable ();
+    score3_function_prologue (file, size);
+  else
+    gcc_unreachable ();
 }
 
 /* Do any necessary cleanup after a function to restore stack, frame,
@@ -215,11 +214,11 @@  score_function_epilogue (FILE *file,
                          HOST_WIDE_INT size ATTRIBUTE_UNUSED)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_function_epilogue (file, size);
+    score7_function_epilogue (file, size);
   else if (TARGET_SCORE3)
-    return score3_function_epilogue (file, size);
-
-  gcc_unreachable ();
+    score3_function_epilogue (file, size);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement TARGET_SCHED_ISSUE_RATE.  */
@@ -245,7 +244,7 @@  score_select_rtx_section (enum machine_m
 
 /* Implement TARGET_IN_SMALL_DATA_P.  */
 static bool
-score_in_small_data_p (tree decl)
+score_in_small_data_p (const_tree decl)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
     return score7_in_small_data_p (decl);
@@ -293,11 +292,11 @@  static void
 score_asm_file_end (void)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_asm_file_end ();
+    score7_asm_file_end ();
   else if (TARGET_SCORE3)
-    return score3_asm_file_end ();
-
-  gcc_unreachable ();
+    score3_asm_file_end ();
+  else
+    gcc_unreachable ();
 }
 
 #define MASK_ALL_CPU_BITS \
@@ -306,7 +305,7 @@  score_asm_file_end (void)
 
 /* Implement TARGET_HANDLE_OPTION.  */
 static bool
-score_handle_option (size_t code, const char *arg, int value)
+score_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
 {
   switch (code)
     {
@@ -370,11 +369,11 @@  static void
 score_option_override (void)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_option_override ();
+    score7_option_override ();
   else if (TARGET_SCORE3)
-    return score3_option_override ();
-
-  return score7_option_override ();
+    score3_option_override ();
+  else
+    score7_option_override ();
 }
 
 /* Implement REGNO_REG_CLASS macro.  */
@@ -490,16 +489,16 @@  score_init_cumulative_args (CUMULATIVE_A
 }
 
 /* Implement TARGET_FUNCTION_ARG_ADVANCE hook.  */
-void
+static void
 score_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
                             const_tree type, bool named)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_function_arg_advance (cum, mode, type, named);
+    score7_function_arg_advance (cum, mode, type, named);
   else if (TARGET_SCORE3)
-    return score3_function_arg_advance (cum, mode, type, named);
-
-  gcc_unreachable ();
+    score3_function_arg_advance (cum, mode, type, named);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement TARGET_ARG_PARTIAL_BYTES macro.  */
@@ -516,7 +515,7 @@  score_arg_partial_bytes (CUMULATIVE_ARGS
 }
 
 /* Implement TARGET_FUNCTION_ARG hook.  */
-rtx
+static rtx
 score_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
                     const_tree type, bool named)
 {
@@ -532,7 +531,7 @@  score_function_arg (CUMULATIVE_ARGS *cum
    VALTYPE is the return type and MODE is VOIDmode.  For libcalls,
    VALTYPE is null and MODE is the mode of the return value.  */
 rtx
-score_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
+score_function_value (const_tree valtype, const_tree func ATTRIBUTE_UNUSED,
                       enum machine_mode mode)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
@@ -548,11 +547,11 @@  static void
 score_asm_trampoline_template (FILE *f)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_asm_trampoline_template (f);
+    score7_asm_trampoline_template (f);
   else if (TARGET_SCORE3)
-    return score3_asm_trampoline_template (f);
-
-  gcc_unreachable ();
+    score3_asm_trampoline_template (f);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement TARGET_TRAMPOLINE_INIT.  */
@@ -561,11 +560,11 @@  score_trampoline_init (rtx m_tramp, tree
 {
   /* ??? These two routines are identical.  */
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_trampoline_init (m_tramp, fndecl, chain_value);
+    score7_trampoline_init (m_tramp, fndecl, chain_value);
   else if (TARGET_SCORE3)
-    return score3_trampoline_init (m_tramp, fndecl, chain_value);
-
-  gcc_unreachable ();
+    score3_trampoline_init (m_tramp, fndecl, chain_value);
+  else
+    gcc_unreachable ();
 }
 
 /* This function is used to implement REG_MODE_OK_FOR_BASE_P macro.  */
@@ -581,7 +580,7 @@  score_regno_mode_ok_for_base_p (int regn
 }
 
 /* Implement TARGET_LEGITIMIZE_ADDRESS_P.  */
-bool
+static bool
 score_legitimate_address_p (enum machine_mode mode, rtx x, bool strict)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
@@ -678,11 +677,11 @@  void
 score_print_operand (FILE *file, rtx op, int c)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_print_operand (file, op, c);
+    score7_print_operand (file, op, c);
   else if (TARGET_SCORE3)
-    return score3_print_operand (file, op, c);
-
-  gcc_unreachable ();
+    score3_print_operand (file, op, c);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement PRINT_OPERAND_ADDRESS macro.  */
@@ -690,11 +689,11 @@  void
 score_print_operand_address (FILE *file, rtx x)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_print_operand_address (file, x);
+    score7_print_operand_address (file, x);
   else if (TARGET_SCORE3)
-    return score3_print_operand_address (file, x);
-
-  gcc_unreachable ();
+    score3_print_operand_address (file, x);
+  else
+    gcc_unreachable ();
 }
 
 /* Implement SELECT_CC_MODE macro.  */
@@ -728,11 +727,11 @@  void
 score_prologue (void)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_prologue ();
+    score7_prologue ();
   else if (TARGET_SCORE3)
-    return score3_prologue ();
-
-  gcc_unreachable ();
+    score3_prologue ();
+  else
+    gcc_unreachable ();
 }
 
 /* Generate the epilogue instructions in a S+core function.  */
@@ -740,11 +739,11 @@  void
 score_epilogue (int sibcall_p)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_epilogue (sibcall_p);
+    score7_epilogue (sibcall_p);
   else if (TARGET_SCORE3)
-    return score3_epilogue (sibcall_p);
-
-  gcc_unreachable ();
+    score3_epilogue (sibcall_p);
+  else
+    gcc_unreachable ();
 }
 
 /* Call and sibcall pattern all need call this function.  */
@@ -752,11 +751,11 @@  void
 score_call (rtx *ops, bool sib)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_call (ops, sib);
+    score7_call (ops, sib);
   else if (TARGET_SCORE3)
-    return score3_call (ops, sib);
-
-  gcc_unreachable ();
+    score3_call (ops, sib);
+  else
+    gcc_unreachable ();
 }
 
 /* Call value and sibcall value pattern all need call this function.  */
@@ -764,22 +763,22 @@  void
 score_call_value (rtx *ops, bool sib)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_call_value (ops, sib);
+    score7_call_value (ops, sib);
   else if (TARGET_SCORE3)
-    return score3_call_value (ops, sib);
-
-  gcc_unreachable ();
+    score3_call_value (ops, sib);
+  else
+    gcc_unreachable ();
 }
 
 void
 score_movsicc (rtx *ops)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_movsicc (ops);
+    score7_movsicc (ops);
   else if (TARGET_SCORE3)
-    return score3_movsicc (ops);
-
-  gcc_unreachable ();
+    score3_movsicc (ops);
+  else
+    gcc_unreachable ();
 }
 
 /* Machine Split  */
@@ -787,22 +786,22 @@  void
 score_movdi (rtx *ops)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_movdi (ops);
+    score7_movdi (ops);
   else if (TARGET_SCORE3)
-    return score3_movdi (ops);
-
-  gcc_unreachable ();
+    score3_movdi (ops);
+  else
+    gcc_unreachable ();
 }
 
 void
 score_zero_extract_andi (rtx *ops)
 {
   if (TARGET_SCORE5 || TARGET_SCORE5U || TARGET_SCORE7 || TARGET_SCORE7D)
-    return score7_zero_extract_andi (ops);
+    score7_zero_extract_andi (ops);
   else if (TARGET_SCORE3)
-    return score3_zero_extract_andi (ops);
-
-  gcc_unreachable ();
+    score3_zero_extract_andi (ops);
+  else
+    gcc_unreachable ();
 }
 
 /* Output asm insn for move.  */
Index: config/score/score.h
===================================================================
--- config/score/score.h	(revision 166491)
+++ config/score/score.h	(working copy)
@@ -420,7 +420,7 @@  enum reg_class
    register REGNO.  In general there is more that one such class;
    choose a class which is "minimal", meaning that no smaller class
    also contains the register.  */
-#define REGNO_REG_CLASS(REGNO)         score_reg_class (REGNO)
+#define REGNO_REG_CLASS(REGNO) (enum reg_class) score_reg_class (REGNO)
 
 /* The following macro defines cover classes for Integrated Register
    Allocator.  Cover classes is a set of non-intersected register
Index: config/score/score-conv.h
===================================================================
--- config/score/score-conv.h	(revision 166491)
+++ config/score/score-conv.h	(working copy)
@@ -52,11 +52,14 @@ 
 #define CE_REG_CLASS_P(C) \
   ((C) == HI_REG || (C) == LO_REG || (C) == CE_REGS)
 
-#define UIMM_IN_RANGE(V, W)    ((V) >= 0 && (V) < ((HOST_WIDE_INT) 1 << (W)))
+#define UIMM_IN_RANGE(V, W) \
+  ((V) >= 0 \
+   && ((unsigned HOST_WIDE_INT) (V) \
+       <= (((unsigned HOST_WIDE_INT) 2 << ((W) - 1)) - 1)))
 
 #define SIMM_IN_RANGE(V, W)                            \
-  ((V) >= (-1 * ((HOST_WIDE_INT) 1 << ((W) - 1)))      \
-   && (V) < (1 * ((HOST_WIDE_INT) 1 << ((W) - 1))))
+  ((V) >= ((HOST_WIDE_INT) -1 << ((W) - 1))      \
+   && (V) <= (((HOST_WIDE_INT) 1 << ((W) - 1)) - 1))
 
 #define IMM_IN_RANGE(V, W, S)  \
   ((S) ? SIMM_IN_RANGE (V, W) : UIMM_IN_RANGE (V, W))