This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch to clean up ip2k port (poisoned target macros, warnings, etc)


The ip2k is another new port which had target hook stuff left behind,
plus other warnings needed zapping:

 > system.h:597:21: warning: poisoning existing macro "ASM_OPEN_PAREN"
 > system.h:597:36: warning: poisoning existing macro "ASM_CLOSE_PAREN"
 > system.h:606:39: warning: poisoning existing macro "SELECT_SECTION"
 > system.h:615:23: warning: poisoning existing macro "EASY_DIV_EXPR"
 > config/ip2k/ip2k.c:3372: warning: `mdr_resequence_xy_yx' defined but not used
 > config/ip2k/ip2k.c:3624: warning: `mdr_propagate_reg_equivs' defined but not used
 > config/ip2k/ip2k.c:3821: warning: `mdr_try_dp_reload_elim' defined but not used
 > config/ip2k/ip2k.c:4030: warning: `mdr_try_move_dp_reload' defined but not used
 > config/ip2k/ip2k.c:4214: warning: `mdr_try_move_pushes' defined but not used
 > config/ip2k/ip2k.c:4627: warning: `mdr_try_propagate_clr' defined but not used
 > config/ip2k/ip2k.c:4850: warning: `mdr_try_propagate_move' defined but not used
 > config/ip2k/ip2k.c:4899: warning: `mdr_try_remove_redundant_insns' defined but not used
 > config/ip2k/ip2k.c:5085: warning: `mdr_try_wreg_elim' defined but not used
 > config/ip2k/ip2k.c:5272: warning: unused parameter `first_insn'
 > config/ip2k/ip2k.c:5274: warning: unused variable `insn'
 > config/ip2k/ip2k.c:5274: warning: unused variable `set'
 > config/ip2k/ip2k.c:91: warning: initialization from incompatible pointer type
 > final.c:2214: warning: statement with no effect
 > final.c:2215: warning: statement with no effect
 > final.c:2307: warning: statement with no effect
 > final.c:2741: warning: statement with no effect
 > insn-output.c:1173: warning: control reaches end of non-void function
 > insn-output.c:131: warning: control reaches end of non-void function
 > insn-output.c:1331: warning: control reaches end of non-void function
 > insn-output.c:162: warning: control reaches end of non-void function
 > insn-output.c:1773: warning: control reaches end of non-void function
 > insn-output.c:208: warning: control reaches end of non-void function
 > insn-output.c:2165: warning: control reaches end of non-void function
 > insn-output.c:2226: warning: control reaches end of non-void function
 > insn-output.c:250: warning: control reaches end of non-void function
 > insn-output.c:2534: warning: control reaches end of non-void function
 > insn-output.c:2579: warning: control reaches end of non-void function
 > insn-output.c:294: warning: control reaches end of non-void function
 > insn-output.c:3051: warning: control reaches end of non-void function
 > insn-output.c:3255: warning: control reaches end of non-void function
 > insn-output.c:3298: warning: control reaches end of non-void function
 > insn-output.c:371: warning: control reaches end of non-void function
 > insn-output.c:475: warning: control reaches end of non-void function


Note in deleting some of the poisoned target macros, I didn't create
new target hook functions (epscially SELECT_SECTION) because I'm
assuming that the elfos.h and defaults.h defaults are sufficient for
this port, ip2k-unknown-elf.  At least, that's the code that the port
is using right now AFAICT.

Tested by linking cc1 in a cross-compile configuration.  Ok to
install on the trunk?

		Thanks,
		--Kaveh

2002-09-04  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* ip2k-protos.h (function_prologue, function_epilogue,
	encode_section_info): Update to match target hook specification.
	* ip2k.c: Wrap `MDR' code in IP2K_MD_REORG_PASS.
	(function_prologue, function_epilogue, encode_section_info):
	Update to match target hook specification.
	* ip2k.h (SELECT_SECTION, SELECT_RTX_SECTION, ASM_OPEN_PAREN,
	ASM_CLOSE_PAREN, EASY_DIV_EXPR): Delete.
	(NOTICE_UPDATE_CC): Cast to void.
	* ip2k.md: Add defaults in switch statements.

diff -rup orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k-protos.h egcc-bib-CVS20020901/gcc/config/ip2k/ip2k-protos.h
--- orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k-protos.h	2002-06-30 15:27:48.000000000 -0400
+++ egcc-bib-CVS20020901/gcc/config/ip2k/ip2k-protos.h	2002-09-02 14:08:35.036338543 -0400
@@ -21,14 +21,14 @@
 extern void asm_file_start PARAMS ((FILE *));
 extern void asm_file_end PARAMS ((FILE *));
 
-extern void function_prologue PARAMS ((FILE *, int));
-extern void function_epilogue PARAMS ((FILE *, int));
+extern void function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
+extern void function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
 extern int find_one_set_bit_p PARAMS ((HOST_WIDE_INT));
 extern int find_one_clear_bit_p PARAMS ((HOST_WIDE_INT));
 
 #ifdef TREE_CODE
 extern void unique_section PARAMS ((tree, int));
-extern void encode_section_info PARAMS ((tree));
+extern void encode_section_info PARAMS ((tree, int));
 extern void asm_output_section_name PARAMS ((FILE *, tree, const char *,
 					     int));
 extern int valid_machine_type_attribute PARAMS ((tree, tree, tree, tree));
diff -rup orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.c egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.c
--- orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.c	2002-08-20 19:27:01.000000000 -0400
+++ egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.c	2002-09-02 15:05:28.334454408 -0400
@@ -52,6 +52,7 @@
 #define CHAIN_FRAMES (frame_pointer_needed || FRAME_POINTER_REQUIRED)
 
 static int ip2k_naked_function_p PARAMS ((tree));
+#ifdef IP2K_MD_REORG_PASS
 static void mdr_resequence_xy_yx PARAMS ((rtx));
 static void mdr_pres_replace_and_recurse PARAMS ((rtx, rtx, rtx));
 static void mdr_propagate_reg_equivs_sequence PARAMS ((rtx, rtx, rtx));
@@ -59,10 +60,7 @@ static void mdr_propagate_reg_equivs PAR
 static int track_dp_reload PARAMS ((rtx , rtx *, int , int));
 static void mdr_try_dp_reload_elim PARAMS ((rtx));
 static void mdr_try_move_dp_reload PARAMS ((rtx));
-static int ip2k_check_can_adjust_stack_ref PARAMS ((rtx, int));
-static void ip2k_adjust_stack_ref PARAMS ((rtx *, int));
 static void mdr_try_move_pushes PARAMS ((rtx));
-static int ip2k_xexp_not_uses_reg_for_mem PARAMS ((rtx, unsigned int));
 static void mdr_try_propagate_clr_sequence PARAMS ((rtx, unsigned int));
 static void mdr_try_propagate_clr PARAMS ((rtx));
 static void mdr_try_propagate_move_sequence PARAMS ((rtx, rtx, rtx));
@@ -70,6 +68,10 @@ static void mdr_try_propagate_move PARAM
 static void mdr_try_remove_redundant_insns PARAMS ((rtx));
 static int track_w_reload PARAMS ((rtx, rtx *, int , int));
 static void mdr_try_wreg_elim PARAMS ((rtx));
+#endif /* IP2K_MD_REORG_PASS */
+static int ip2k_check_can_adjust_stack_ref PARAMS ((rtx, int));
+static void ip2k_adjust_stack_ref PARAMS ((rtx *, int));
+static int ip2k_xexp_not_uses_reg_for_mem PARAMS ((rtx, unsigned int));
 
 
 /* Initialize the GCC target structure.  */
@@ -175,7 +177,7 @@ ip2k_naked_function_p (func)
 void
 function_prologue (file, size)
      FILE *file;
-     int size;
+     HOST_WIDE_INT size;
 {
   int leaf_func_p;
   int main_p;
@@ -297,7 +299,7 @@ function_prologue (file, size)
 void
 function_epilogue (file, size)
      FILE *file;
-     int size;
+     HOST_WIDE_INT size;
 {
   int leaf_func_p;
   int reg,savelimit;
@@ -3167,8 +3169,9 @@ valid_machine_decl_attribute (decl, attr
 /* Encode section information about tree DECL.  */
   
 void
-encode_section_info (decl)
+encode_section_info (decl, first)
      tree decl;
+     int first ATTRIBUTE_UNUSED;
 {
   if (! DECL_P (decl))
     return;
@@ -3355,6 +3358,7 @@ ip2k_address_cost (x)
    much cheaper and the move from this to the original source operand will be
    no more expensive than the original move.  */
 
+#ifdef IP2K_MD_REORG_PASS
 static void
 mdr_resequence_xy_yx (first_insn)
      rtx first_insn;
@@ -4100,6 +4104,7 @@ mdr_try_move_dp_reload (first_insn)
 	}
     }
 }
+#endif /* IP2K_MD_REORG_PASS */
 
 /* Look to see if the expression, x, can have any stack references offset by
    a fixed constant, offset.  If it definitely can then returns non-zero.  */
@@ -4193,6 +4198,7 @@ ip2k_adjust_stack_ref (x, offset)
     }
 }
 
+#ifdef IP2K_MD_REORG_PASS
 /* As part of the machine-dependent reorg we look to move push instructions
    to earlier points within the file.  Moving these out of the way allows more
    peepholes to match.  */
@@ -4636,6 +4642,7 @@ mdr_try_propagate_clr (first_insn)
 	}
     }
 }
+#endif /* IP2K_MD_REORG_PASS */
 
 /* Look to see if the expression, x, does not make any memory references
    via the specified register.  This is very conservative and only returns
@@ -4693,6 +4700,7 @@ ip2k_xexp_not_uses_reg_for_mem (x, regno
     }
 }
 
+#ifdef IP2K_MD_REORG_PASS
 /* Assist the following function, mdr_try_propagate_move().  */
 
 static void
@@ -5249,6 +5257,7 @@ mdr_try_wreg_elim (first_insn)
 
   free (ip2k_we_jump_targets);
 }
+#endif /* IP2K_MD_REORG_PASS */
 
 /* We perform a lot of untangling of the RTL within the reorg pass since
    the IP2k requires some really bizarre (and really undesireable) things
@@ -5258,9 +5267,11 @@ mdr_try_wreg_elim (first_insn)
 
 void
 machine_dependent_reorg (first_insn)
-     rtx first_insn;
+     rtx first_insn ATTRIBUTE_UNUSED;
 {
+#ifdef IP2K_MD_REORG_PASS
   rtx insn, set;
+#endif
 
   CC_STATUS_INIT;
 
diff -rup orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.h egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.h
--- orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.h	2002-09-01 22:46:03.000000000 -0400
+++ egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.h	2002-09-02 15:08:56.397882846 -0400
@@ -1960,30 +1960,6 @@ do {									\
    operation to identify the following data as writable initialized
    data.  Normally `".data"' is right.  */
 
-
-#undef SELECT_SECTION		/* Hide default.  */
-#define SELECT_SECTION(EXP,RELOC)	data_section ()
-/* `SELECT_SECTION (EXP, RELOC)'
-   A C statement or statements to switch to the appropriate section
-   for output of EXP.  You can assume that EXP is either a `VAR_DECL'
-   node or a constant of some sort.  RELOC indicates whether the
-   initial value of EXP requires link-time relocations.  Select the
-   section by calling `text_section' or one of the alternatives for
-   other sections.
-
-   Do not define this macro if you put all read-only variables and
-   constants in the read-only data section (usually the text section).  */
-
-/* `SELECT_RTX_SECTION (MODE, RTX)'
-   A C statement or statements to switch to the appropriate section
-   for output of RTX in mode MODE.  You can assume that RTX is some
-   kind of constant in RTL.  The argument MODE is redundant except in
-   the case of a `const_int' rtx.  Select the section by calling
-   `text_section' or one of the alternatives for other sections.
-
-   Do not define this macro if you put all constants in the read-only
-   data section.  */
-
 #define JUMP_TABLES_IN_TEXT_SECTION 1
 /* Define this macro if jump tables (for `tablejump' insns) should be
    output in the text section, along with the assembler instructions.
@@ -2073,18 +2049,6 @@ do {									\
    If you do not define this macro, the default is that only the
    character `;' is treated as a logical line separator.  */
 
-#define ASM_OPEN_PAREN "("
-#define ASM_CLOSE_PAREN ")"
-/* These macros are defined as C string constant, describing the
-   syntax in the assembler for grouping arithmetic expressions.  The
-   following definitions are correct for most assemblers:
-
-   #define ASM_OPEN_PAREN "("
-   #define ASM_CLOSE_PAREN ")"
-
-   These macros are provided by `real.h' for writing the definitions of
-   `ASM_OUTPUT_DOUBLE' and the like:  */
-
 #define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED)	\
 do {							\
      fputs ("\t.comm ", (STREAM));			\
@@ -2335,15 +2299,6 @@ do {							\
    register.  Most RISC machines have this property and most CISC
    machines do not.  */
 
-#define EASY_DIV_EXPR TRUNC_DIV_EXPR
-/* An alias for a tree code that is the easiest kind of division to
-   compile code for in the general case.  It may be `TRUNC_DIV_EXPR',
-   `FLOOR_DIV_EXPR', `CEIL_DIV_EXPR' or `ROUND_DIV_EXPR'.  These four
-   division operators differ in how they round the result to an
-   integer.  `EASY_DIV_EXPR' is used when it is permissible to use
-   any of those kinds of division and the choice should be made on
-   the basis of efficiency.  */
-
 #define MOVE_MAX 1
 /* The maximum number of bytes that a single instruction can move
    quickly between memory and registers or between two memory
@@ -2472,7 +2427,7 @@ extern int ip2k_reorg_merge_qimode;
    after execution of an instruction whose pattern is EXP.
    Do not alter them if the instruction would not alter the cc's.  */
 
-#define NOTICE_UPDATE_CC(EXP, INSN) (0)
+#define NOTICE_UPDATE_CC(EXP, INSN) (void)(0)
 
 /* Output assembler code to FILE to increment profiler label # LABELNO
    for profiling a function entry.  */
diff -rup orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.md egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.md
--- orig/egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.md	2002-06-30 15:27:48.000000000 -0400
+++ egcc-bib-CVS20020901/gcc/config/ip2k/ip2k.md	2002-09-02 11:47:35.763896666 -0400
@@ -387,6 +387,8 @@
         if (!find_regno_note (insn, REG_DEAD, REG_IP))
 	  OUT_AS1 (dec, ipl);
 	return \"\";
+      default:
+        abort ();
       }
   }")
 
@@ -414,6 +416,8 @@
         if (!find_regno_note (insn, REG_DEAD, REG_IP))
 	  OUT_AS1 (dec, ipl);
 	return \"\";
+      default:
+        abort ();
       }
   }")
 
@@ -457,6 +461,8 @@
               OUT_AS2 (sub, ipl, w);
 	  }
         return \"\";
+      default:
+        abort ();
       }
   }")
 
@@ -620,6 +626,8 @@
 	       AS2 (mov, %L0, w) CR_TAB
 	       AS1 (pop, %H2%>) CR_TAB
 	       AS2 (mov, %L2, w);
+      default:
+        abort ();
       }
   }")
 
@@ -726,7 +734,9 @@
 	       AS1 (pop, %B2%>) CR_TAB
 	       AS1 (pop, %C2%>) CR_TAB
 	       AS2 (mov, %D2, w);
-      }
+      default:
+        abort ();
+     }
   }")
 
 ;; We have to be *very* careful with this one to use predicates that do not 
@@ -981,6 +991,8 @@
 	  p += sprintf (p, \"\;and\\tw,#$%2.2x\;or\\t%%0,w\", mask);
 	  return buff;
         }
+      default:
+        abort ();
       }
   }"
   [(set_attr "skip" "yes,yes,no,no,no,no,no")
@@ -1145,6 +1157,8 @@
 	       AS2 (mov, w, %H1) CR_TAB
 	       AS2 (addc, 1(SP), w);
       }
+    default:
+      abort ();
     }
   }"
   [(set_attr "clobberw" "no,yes,yes,yes,yes,yes,yes,yes")])
@@ -2050,6 +2064,8 @@
 	     AS2 (mov, %A0, w) CR_TAB
 	     AS2 (mov, w, %A2) CR_TAB
 	     AS2 (subc, %A0, w);
+    default:
+      abort ();
     }
   }")
 
@@ -2214,6 +2230,8 @@
 	     AS2 (mov, %S0, w) CR_TAB
 	     AS2 (mov, w, %S2) CR_TAB
 	     AS2 (subc, %S0, w);
+    default:
+      abort ();
     }
   }")
 
@@ -3338,6 +3356,8 @@
 	       AS1 (page, 1b) CR_TAB
 	       AS1 (jmp, 1b);
       }
+    default:
+      abort ();
     }
   }")
 
@@ -3782,6 +3802,8 @@
 	       AS1 (page, 1b) CR_TAB
 	       AS1 (jmp, 1b);
       }
+    default:
+      abort ();
     }
   }")
 
@@ -3848,6 +3870,8 @@
        	       AS2 (mulu, w, %e2) CR_TAB
 	       AS2 (mov, w, mulh) CR_TAB
 	       AS2 (mov, %0, w);
+      default:
+        abort ();
       }
   }")
 
@@ -4202,6 +4226,8 @@
 	       AS1 (page, 1b) CR_TAB
 	       AS1 (jmp, 1b);
       }
+    default:
+      abort ();
     }
   }")
 
@@ -4425,6 +4451,8 @@
 	       AS2 (mov, %L0, w) CR_TAB
 	       AS2 (mov, w, %H1) CR_TAB
 	       AS2 (mov, %H0, w);
+      default:
+        abort ();
       }
   }")
 
@@ -5287,6 +5315,8 @@
         OUT_AS2 (mov, w, %1);
 	OUT_AS2 (add, w, %5);
 	break;
+      default:
+        abort ();
       }
 
     OUT_AS2 (cmp, w, %2);
@@ -5315,6 +5345,8 @@
 	OUT_AS1 (page, __indcall);
 	OUT_AS1 (jmp, __indcall%>%>);
 	return \"\";
+      default:
+        abort ();
       }
   }")
 
@@ -5595,6 +5627,8 @@
           OUT_AS1 (sz, );
         return AS1 (page, %2) CR_TAB
                AS1 (jmp, %2);
+      default:
+        abort ();
       }
   }")
 
@@ -5641,6 +5675,8 @@
           OUT_AS1 (sz, );
         return AS1 (page, %2) CR_TAB
                AS1 (jmp, %2);
+      default:
+        abort ();
       }
   }")
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]