This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
A few warning patches ...
- To: egcs-patches at cygnus dot com
- Subject: A few warning patches ...
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sun, 25 Oct 1998 12:57:36 -0500 (EST)
Here's a few warning fixes. Okay to install?
--Kaveh
Sun Oct 25 09:24:27 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (recog.o): Depend on toplev.h.
(insn-emit.o): Depend on recog.h.
(insn-peep.o): Depend on recog.h and insn-config.h.
* combine.c (simplify_set): Remove unused variable `scratches'.
* final.c (final_scan_insn): Wrap declaration of variables `vlen'
and `idx' in macro conditional controlling their use.
* genemit.c (main): Make the generated output file include
recog.h. Don't have it declare `insn_operand_constraint', since
we get it from recog.h.
* genpeep.c (main): Make the generated output file include
insn-config.h and recog.h.
* recog.h: Include toplev.h.
(extract_insn): Remove unused variable `p'.
* regclass.c (fix_register): Add missing braces around initializer
for `what_option'.
(allocate_reg_info): Move variable `i' into the scope where it is
used. Change its type to `size_t'.
* reload1.c (reg_eliminate): Add missing initializers.
(delete_output_reload): Add explicit braces to avoid ambiguous `else'.
diff -rup orig/egcs-CVS19981024/gcc/Makefile.in egcs-CVS19981024/gcc/Makefile.in
--- orig/egcs-CVS19981024/gcc/Makefile.in Sat Oct 24 21:56:32 1998
+++ egcs-CVS19981024/gcc/Makefile.in Sun Oct 25 07:44:17 1998
@@ -1526,7 +1526,7 @@ final.o : final.c $(CONFIG_H) system.h $
toplev.h reload.h dwarfout.h dwarf2out.h sdbout.h dbxout.h
recog.o : recog.c $(CONFIG_H) system.h $(RTL_H) \
$(REGS_H) $(RECOG_H) hard-reg-set.h flags.h insn-config.h insn-attr.h \
- insn-flags.h insn-codes.h real.h
+ insn-flags.h insn-codes.h real.h toplev.h
reg-stack.o : reg-stack.c $(CONFIG_H) system.h $(RTL_H) $(TREE_H) \
$(REGS_H) hard-reg-set.h flags.h insn-config.h insn-flags.h toplev.h
dyn-string.o: dyn-string.c dyn-string.h $(CONFIG_H) system.h gansidecl.h
@@ -1605,7 +1605,7 @@ s-codes : $(md_file) gencodes $(srcdir)/
touch s-codes
insn-emit.o : insn-emit.c $(CONFIG_H) $(RTL_H) $(EXPR_H) real.h output.h \
- insn-config.h insn-flags.h insn-codes.h system.h reload.h
+ insn-config.h insn-flags.h insn-codes.h system.h reload.h recog.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-emit.c
insn-emit.c: s-emit ; @true
@@ -1644,7 +1644,8 @@ s-extract : $(md_file) genextract $(srcd
$(srcdir)/move-if-change tmp-extract.c insn-extract.c
touch s-extract
-insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h system.h
+insn-peep.o : insn-peep.c $(CONFIG_H) $(RTL_H) $(REGS_H) output.h real.h \
+ system.h insn-config.h recog.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c insn-peep.c
insn-peep.c: s-peep ; @true
diff -rup orig/egcs-CVS19981024/gcc/combine.c egcs-CVS19981024/gcc/combine.c
--- orig/egcs-CVS19981024/gcc/combine.c Sat Oct 24 21:56:42 1998
+++ egcs-CVS19981024/gcc/combine.c Sun Oct 25 08:32:38 1998
@@ -4632,7 +4632,6 @@ simplify_set (x)
&& exact_log2 (mask = nonzero_bits (op0, GET_MODE (op0))) >= 0)
{
rtx pat = PATTERN (other_insn), note = 0;
- int scratches;
if ((recog_for_combine (&pat, other_insn, ¬e) < 0
&& ! check_asm_operands (pat)))
diff -rup orig/egcs-CVS19981024/gcc/final.c egcs-CVS19981024/gcc/final.c
--- orig/egcs-CVS19981024/gcc/final.c Sat Oct 24 21:56:52 1998
+++ egcs-CVS19981024/gcc/final.c Sun Oct 25 08:55:31 1998
@@ -2425,7 +2425,9 @@ final_scan_insn (insn, file, optimize, p
if (GET_CODE (body) == ADDR_VEC || GET_CODE (body) == ADDR_DIFF_VEC)
{
+#if !(defined(ASM_OUTPUT_ADDR_VEC) || defined(ASM_OUTPUT_ADDR_DIFF_VEC))
register int vlen, idx;
+#endif
if (prescan > 0)
break;
diff -rup orig/egcs-CVS19981024/gcc/genemit.c egcs-CVS19981024/gcc/genemit.c
--- orig/egcs-CVS19981024/gcc/genemit.c Sat Oct 24 21:57:16 1998
+++ egcs-CVS19981024/gcc/genemit.c Sun Oct 25 07:51:58 1998
@@ -771,11 +771,11 @@ from the machine description file `md'.
printf ("#include \"real.h\"\n");
printf ("#include \"flags.h\"\n");
printf ("#include \"output.h\"\n");
- printf ("#include \"insn-config.h\"\n\n");
- printf ("#include \"insn-flags.h\"\n\n");
- printf ("#include \"insn-codes.h\"\n\n");
- printf ("#include \"reload.h\"\n");
- printf ("extern char *insn_operand_constraint[][MAX_RECOG_OPERANDS];\n\n");
+ printf ("#include \"insn-config.h\"\n");
+ printf ("#include \"insn-flags.h\"\n");
+ printf ("#include \"insn-codes.h\"\n");
+ printf ("#include \"recog.h\"\n");
+ printf ("#include \"reload.h\"\n\n");
printf ("extern rtx recog_operand[];\n");
printf ("#define operands emit_operand\n\n");
printf ("#define FAIL return (end_sequence (), _val)\n");
diff -rup orig/egcs-CVS19981024/gcc/genpeep.c egcs-CVS19981024/gcc/genpeep.c
--- orig/egcs-CVS19981024/gcc/genpeep.c Sat Oct 24 21:57:16 1998
+++ egcs-CVS19981024/gcc/genpeep.c Sun Oct 25 07:38:10 1998
@@ -467,10 +467,12 @@ from the machine description file `md'.
printf ("#include \"config.h\"\n");
printf ("#include \"system.h\"\n");
+ printf ("#include \"insn-config.h\"\n");
printf ("#include \"rtl.h\"\n");
printf ("#include \"regs.h\"\n");
printf ("#include \"output.h\"\n");
printf ("#include \"real.h\"\n");
+ printf ("#include \"recog.h\"\n");
printf ("#include \"except.h\"\n\n");
printf ("extern rtx peep_operand[];\n\n");
diff -rup orig/egcs-CVS19981024/gcc/recog.c egcs-CVS19981024/gcc/recog.c
--- orig/egcs-CVS19981024/gcc/recog.c Sat Oct 24 21:57:39 1998
+++ egcs-CVS19981024/gcc/recog.c Sun Oct 25 07:42:16 1998
@@ -31,6 +31,7 @@ Boston, MA 02111-1307, USA. */
#include "hard-reg-set.h"
#include "flags.h"
#include "real.h"
+#include "toplev.h"
#ifndef STACK_PUSH_CODE
#ifdef STACK_GROWS_DOWNWARD
@@ -1758,7 +1759,6 @@ extract_insn (insn)
recog_n_operands = noperands = asm_noperands (body);
if (noperands >= 0)
{
- char *p;
/* This insn is an `asm' with operands. */
/* expand_asm_operands makes sure there aren't too many operands. */
diff -rup orig/egcs-CVS19981024/gcc/regclass.c egcs-CVS19981024/gcc/regclass.c
--- orig/egcs-CVS19981024/gcc/regclass.c Sat Oct 24 21:57:39 1998
+++ egcs-CVS19981024/gcc/regclass.c Sun Oct 25 07:28:23 1998
@@ -584,8 +584,8 @@ fix_register (name, fixed, call_used)
&& (fixed == 0 || call_used == 0))
{
static char* what_option[2][2] = {
- "call-saved", "call-used",
- "no-such-option", "fixed" };
+ { "call-saved", "call-used" },
+ { "no-such-option", "fixed" }};
error ("can't use '%s' as a %s register", name,
what_option[fixed][call_used]);
@@ -1842,7 +1842,6 @@ allocate_reg_info (num_regs, new_p, renu
{
static size_t regno_allocated = 0;
static short *renumber = (short *)0;
- int i;
size_t size_info;
size_t size_renumber;
size_t min = (new_p) ? 0 : reg_n_max;
@@ -1937,6 +1936,8 @@ allocate_reg_info (num_regs, new_p, renu
{
size_t max = max_index;
size_t local_min = min - min_index;
+ size_t i;
+
if (min < min_index)
local_min = 0;
if (!reg_data->used_p) /* page just allocated with calloc */
diff -rup orig/egcs-CVS19981024/gcc/reload1.c egcs-CVS19981024/gcc/reload1.c
--- orig/egcs-CVS19981024/gcc/reload1.c Sat Oct 24 21:57:42 1998
+++ egcs-CVS19981024/gcc/reload1.c Sun Oct 25 07:19:55 1998
@@ -334,7 +334,8 @@ static struct elim_table
#ifdef ELIMINABLE_REGS
ELIMINABLE_REGS;
#else
- {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}};
+ {{ FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM,
+ 0, 0, 0, 0, 0, 0, 0, NULL_RTX, NULL_RTX }};
#endif
#define NUM_ELIMINABLE_REGS (sizeof reg_eliminate / sizeof reg_eliminate[0])
@@ -8117,19 +8118,21 @@ delete_output_reload (insn, j, last_relo
while (GET_CODE (reg2) == SUBREG)
reg2 = SUBREG_REG (reg2);
if (rtx_equal_p (reg2, reg))
- if (reload_inherited[k] || reload_override_in[k] || k == j)
- {
- n_inherited++;
- reg2 = reload_out_reg[k];
- if (! reg2)
- continue;
- while (GET_CODE (reg2) == SUBREG)
- reg2 = XEXP (reg2, 0);
- if (rtx_equal_p (reg2, reg))
+ {
+ if (reload_inherited[k] || reload_override_in[k] || k == j)
+ {
n_inherited++;
- }
- else
- return;
+ reg2 = reload_out_reg[k];
+ if (! reg2)
+ continue;
+ while (GET_CODE (reg2) == SUBREG)
+ reg2 = XEXP (reg2, 0);
+ if (rtx_equal_p (reg2, reg))
+ n_inherited++;
+ }
+ else
+ return;
+ }
}
n_occurrences = count_occurrences (PATTERN (insn), reg);
if (substed)