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

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

Comments

Joern Rennecke - Nov. 9, 2010, 6:57 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/44760
	* config/iq2000/iq2000.h (REGISTER_NAMES): Remove trailing semicolon.
	(REGNO_MODE_OK_FOR_BASE_P): Cast REGNO to int before passing it to
	GP_REG_OR_PSEUDO_STRICT_P.
	* config/iq2000/iq2000.md (andsi3+1): Add gcc_unreachable for
	unexpected alternative.
	(*movsf_internal): Likewise.
	(indirect_jump): Replace call to non-existant function with call to
	internal_error.
	(tablejump): Likewise.
	* config/iq2000/iq2000.c: Include df.h .
	(iq2000_function_arg_advance): Use CONST_CAST2.
	(compute_frame_size, iq2000_expand_prologue): Remove unused variables.
	(iq2000_can_eliminate): Call leaf_function_p instead of testing for
	a non-zero function address.
	(iq2000_initial_elimination_offset): Add gcc_unreachable for
	unexpected value of FROM.
	(symbolic_expression_p): Delete.
	(iq2000_function_value): Constify func.
	(expand_one_builtin): Use expand_normal.
	(iq2000_print_operand): Don't print VALUE if calculating it failed.
Nick Clifton - Nov. 10, 2010, 8:39 a.m.
Hi Joern,

> Built on i686-pc-linux-gnu with gcc (GCC) 4.6.0 20101103 (experimental).

> 2010-11-09  Joern Rennecke  <amylaar@spamcop.net>
>
> 	PR target/44760
> 	* config/iq2000/iq2000.h (REGISTER_NAMES): Remove trailing semicolon.
> 	(REGNO_MODE_OK_FOR_BASE_P): Cast REGNO to int before passing it to
> 	GP_REG_OR_PSEUDO_STRICT_P.
> 	* config/iq2000/iq2000.md (andsi3+1): Add gcc_unreachable for
> 	unexpected alternative.
> 	(*movsf_internal): Likewise.
> 	(indirect_jump): Replace call to non-existant function with call to
> 	internal_error.
> 	(tablejump): Likewise.
> 	* config/iq2000/iq2000.c: Include df.h .
> 	(iq2000_function_arg_advance): Use CONST_CAST2.
> 	(compute_frame_size, iq2000_expand_prologue): Remove unused variables.
> 	(iq2000_can_eliminate): Call leaf_function_p instead of testing for
> 	a non-zero function address.
> 	(iq2000_initial_elimination_offset): Add gcc_unreachable for
> 	unexpected value of FROM.
> 	(symbolic_expression_p): Delete.
> 	(iq2000_function_value): Constify func.
> 	(expand_one_builtin): Use expand_normal.
> 	(iq2000_print_operand): Don't print VALUE if calculating it failed.

Approved - please apply.

Cheers
   Nick

Patch

Index: config/iq2000/iq2000.h
===================================================================
--- config/iq2000/iq2000.h	(revision 166491)
+++ config/iq2000/iq2000.h	(working copy)
@@ -509,7 +509,7 @@  typedef struct iq2000_args
  "%8",   "%9",   "%10",  "%11",  "%12",  "%13",  "%14",  "%15",		\
  "%16",  "%17",  "%18",  "%19",  "%20",  "%21",  "%22",  "%23",		\
  "%24",  "%25",  "%26",  "%27",  "%28",  "%29",  "%30",  "%31",  "%rap"	\
-};
+}
 
 #define ADDITIONAL_REGISTER_NAMES					\
 {									\
@@ -832,7 +832,7 @@  enum processor_type
   (((regno) >= FIRST_PSEUDO_REGISTER) || (BASE_REG_P ((regno), (mode))))
 
 #define REGNO_MODE_OK_FOR_BASE_P(regno, mode) \
-  GP_REG_OR_PSEUDO_STRICT_P ((regno), (mode))
+  GP_REG_OR_PSEUDO_STRICT_P ((int) (regno), (mode))
 
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
    and check its validity for a certain class.
Index: config/iq2000/iq2000.md
===================================================================
--- config/iq2000/iq2000.md	(revision 166491)
+++ config/iq2000/iq2000.md	(working copy)
@@ -365,6 +365,8 @@  (define_insn ""
 	  return \"andoi\\t%0,%1,%x2\";
 	}
     }
+  else
+    gcc_unreachable ();
 }"
   [(set_attr "type"	"arith")
    (set_attr "mode"	"SI")])
@@ -889,6 +891,8 @@  (define_insn "*movsf_internal"
     return \"lw\\t%0,%1\";
   else if (which_alternative == 2)
     return \"sw\\t%1,%0\";
+  else
+    gcc_unreachable ();
 }"
   [(set_attr "length" "4,4,4")
    (set_attr "type" "arith,load,store")]
@@ -1340,7 +1344,7 @@  (define_expand "indirect_jump"
       if (!(Pmode == DImode))
 	emit_jump_insn (gen_indirect_jump_internal1 (operands[0]));
       else
-	emit_jump_insn (gen_indirect_jump_internal2 (operands[0]));
+	internal_error (\"unimplemented functionality\");
 
       DONE;
     }
@@ -1367,7 +1371,7 @@  (define_expand "tablejump"
       if (!(Pmode == DImode))
 	emit_jump_insn (gen_tablejump_internal1 (operands[0], operands[1]));
       else
-	emit_jump_insn (gen_tablejump_internal2 (operands[0], operands[1]));
+	internal_error (\"unimplemented functionality\");
 
       DONE;
     }
Index: config/iq2000/iq2000.c
===================================================================
--- config/iq2000/iq2000.c	(revision 166491)
+++ config/iq2000/iq2000.c	(working copy)
@@ -46,6 +46,7 @@  along with GCC; see the file COPYING3.  
 #include "target.h"
 #include "target-def.h"
 #include "langhooks.h"
+#include "df.h"
 
 /* Enumeration for all of the relational tests, so that we can build
    arrays indexed by the test type, and not worry about the order
@@ -1150,7 +1151,7 @@  iq2000_function_arg_advance (CUMULATIVE_
 	       "function_adv({gp reg found = %d, arg # = %2d, words = %2d}, %4s, ",
 	       cum->gp_reg_found, cum->arg_number, cum->arg_words,
 	       GET_MODE_NAME (mode));
-      fprintf (stderr, "%p", (void *) type);
+      fprintf (stderr, "%p", CONST_CAST2 (void *, const_tree,  type));
       fprintf (stderr, ", %d )\n\n", named);
     }
 
@@ -1632,8 +1633,6 @@  compute_frame_size (HOST_WIDE_INT size)
   HOST_WIDE_INT gp_reg_size;	/* # bytes needed to store gp regs.  */
   HOST_WIDE_INT fp_reg_size;	/* # bytes needed to store fp regs.  */
   long mask;			/* mask of saved gp registers.  */
-  int  fp_inc;			/* 1 or 2 depending on the size of fp regs.  */
-  long fp_bits;			/* bitmask to use for each fp register.  */
 
   gp_reg_size = 0;
   fp_reg_size = 0;
@@ -1674,8 +1673,6 @@  compute_frame_size (HOST_WIDE_INT size)
 	}
     }
 
-  fp_inc = 2;
-  fp_bits = 3;
   gp_reg_rounded = IQ2000_STACK_ALIGN (gp_reg_size);
   total_size += gp_reg_rounded + IQ2000_STACK_ALIGN (fp_reg_size);
 
@@ -1730,7 +1727,7 @@  iq2000_can_eliminate (const int from, co
 {
   return (from == RETURN_ADDRESS_POINTER_REGNUM
           && (! leaf_function_p ()
-              || (to == GP_REG_FIRST + 31 && leaf_function_p)))
+              || (to == GP_REG_FIRST + 31 && leaf_function_p ())))
           || (from != RETURN_ADDRESS_POINTER_REGNUM
               && (to == HARD_FRAME_POINTER_REGNUM
                   || (to == STACK_POINTER_REGNUM
@@ -1759,6 +1756,8 @@  iq2000_initial_elimination_offset (int f
 	     + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT)) 
 		* (BYTES_BIG_ENDIAN != 0)); 
     }
+  else
+    gcc_unreachable ();
 
   return offset;
 }
@@ -2002,7 +2001,7 @@  iq2000_expand_prologue (void)
 
       for (i = 0; i < num; i++)
 	{
-	  rtx insn, pattern;
+	  rtx pattern;
 
 	  pattern = RTVEC_ELT (adjust, i);
 	  if (GET_CODE (pattern) != SET
@@ -2010,7 +2009,7 @@  iq2000_expand_prologue (void)
 	    abort_with_insn (pattern, "Insn is not a shift");
 	  PUT_CODE (SET_SRC (pattern), ASHIFTRT);
 
-	  insn = emit_insn (pattern);
+	  emit_insn (pattern);
 	}
     }
 
@@ -2165,27 +2164,6 @@  iq2000_can_use_return_insn (void)
   return compute_frame_size (get_frame_size ()) == 0;
 }
 
-/* Returns nonzero if X contains a SYMBOL_REF.  */
-
-static int
-symbolic_expression_p (rtx x)
-{
-  if (GET_CODE (x) == SYMBOL_REF)
-    return 1;
-
-  if (GET_CODE (x) == CONST)
-    return symbolic_expression_p (XEXP (x, 0));
-
-  if (UNARY_P (x))
-    return symbolic_expression_p (XEXP (x, 0));
-
-  if (ARITHMETIC_P (x))
-    return (symbolic_expression_p (XEXP (x, 0))
-	    || symbolic_expression_p (XEXP (x, 1)));
-
-  return 0;
-}
-
 /* Choose the section to use for the constant rtx expression X that has
    mode MODE.  */
 
@@ -2251,7 +2229,7 @@  iq2000_function_value (const_tree valtyp
   int reg = GP_RETURN;
   enum machine_mode mode = TYPE_MODE (valtype);
   int unsignedp = TYPE_UNSIGNED (valtype);
-  tree func = fn_decl_or_type;
+  const_tree func = fn_decl_or_type;
 
   if (fn_decl_or_type
       && !DECL_P (fn_decl_or_type))
@@ -2651,7 +2629,7 @@  expand_one_builtin (enum insn_code icode
   for (i = 0; i < argcount; i++)
     {
       arg[i] = CALL_EXPR_ARG (exp, i);
-      op[i] = expand_expr (arg[i], NULL_RTX, VOIDmode, 0);
+      op[i] = expand_normal (arg[i]);
       mode[i] = insn_data[icode].operand[i].mode;
       if (code[i] == CONST_INT && GET_CODE (op[i]) != CONST_INT)
 	error ("argument %qd is not a constant", i + 1);
@@ -3198,7 +3176,8 @@  iq2000_print_operand (FILE *file, rtx op
       if (code != CONST_INT
 	  || (value = exact_log2 (INTVAL (op))) < 0)
 	output_operand_lossage ("invalid %%p value");
-      fprintf (file, "%d", value);
+      else
+	fprintf (file, "%d", value);
     }
 
   else if (letter == 'Z')