This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
warning fixes installed
- To: gcc-patches at gcc dot gnu dot org
- Subject: warning fixes installed
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Sun, 11 Jun 2000 00:30:37 -0400 (EDT)
I installed the following warnings fixes. Bootstrapped on
i686-pc-linux-gnu, no regressions.
It reduces the number of warnings by 145. Most (~130) are fixed by
the cast in i386.h (MEMORY_MOVE_COST) which zaps a bunch of
"signed/unsigned in conditional expression" warnings.
--Kaveh
2000-06-10 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bb-reorder.c (build_scope_forest): Initialize variable
`curr_scope'.
* calls.c (expand_call): Likewise for variables
`save_pending_stack_adjust' and `save_stack_pointer_delta'.
* i386.c (function_arg_advance, function_arg): Cast to avoid
signed/unsigned warnings.
* i386.h (MEMORY_MOVE_COST): Likewise.
* ifcvt.c (cond_exec_process_if_block): Initialize variables
`else_start' and `else_end'.
* libgcc2.h (__eh_alloc, __eh_free): Prototype.
* regrename.c (rr_replace_reg): Initialize variable `dest_subregno'.
ch:
* Makefile.in (EXPR_H): New dependency variable.
(actions.o, expr.o): Use EXPR_H.
(lang.o): Depend on RTL_H and EXPR_H.
* lang.c: Include rtl.h and expr.h.
(lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
cp:
* decl2.c (compare_options): Don't needlessly cast away const-ness.
f:
* com.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
java:
* decl.c (create_primitive_vtable): Prototype.
* jcf-write.c (generate_bytecode_insns): Initialize variable
`saved_context'.
* lang.c (lang_get_alias_set): Mark parameter with ATTRIBUTE_UNUSED.
diff -rup orig/egcs-CVS20000609/gcc/bb-reorder.c egcs-CVS20000609/gcc/bb-reorder.c
--- orig/egcs-CVS20000609/gcc/bb-reorder.c Tue May 30 17:16:43 2000
+++ egcs-CVS20000609/gcc/bb-reorder.c Sat Jun 10 19:22:36 2000
@@ -964,7 +964,7 @@ build_scope_forest (forest)
rtx x;
int level, bbi, i;
basic_block curr_bb;
- scope root, curr_scope;
+ scope root, curr_scope = 0;
forest->num_trees = 0;
forest->trees = NULL;
diff -rup orig/egcs-CVS20000609/gcc/calls.c egcs-CVS20000609/gcc/calls.c
--- orig/egcs-CVS20000609/gcc/calls.c Fri Jun 9 14:37:00 2000
+++ egcs-CVS20000609/gcc/calls.c Sat Jun 10 19:20:47 2000
@@ -2490,8 +2490,8 @@ expand_call (exp, target, ignore)
recursion "call". That way we know any adjustment after the tail
recursion call can be ignored if we indeed use the tail recursion
call expansion. */
- int save_pending_stack_adjust;
- int save_stack_pointer_delta;
+ int save_pending_stack_adjust = 0;
+ int save_stack_pointer_delta = 0;
rtx insns;
rtx before_call, next_arg_reg;
diff -rup orig/egcs-CVS20000609/gcc/ch/Makefile.in egcs-CVS20000609/gcc/ch/Makefile.in
--- orig/egcs-CVS20000609/gcc/ch/Makefile.in Tue Jun 6 08:19:48 2000
+++ egcs-CVS20000609/gcc/ch/Makefile.in Sat Jun 10 18:57:32 2000
@@ -249,6 +249,7 @@ native: config.status ../cc1chill$(exeex
# CHILL language specific files.
+EXPR_H = $(srcdir)/../expr.h ../insn-codes.h
RTL_H = $(srcdir)/../rtl.h $(srcdir)/../rtl.def \
$(srcdir)/../machmode.h $(srcdir)/../machmode.def
TREE_H = $(srcdir)/../tree.h $(srcdir)/../real.h $(srcdir)/../tree.def \
@@ -274,8 +275,7 @@ $(srcdir)/hash.h:
actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
lex.h $(srcdir)/../flags.h $(srcdir)/../input.h \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h \
- $(srcdir)/../toplev.h
+ $(EXPR_H) $(srcdir)/../system.h $(srcdir)/../toplev.h
convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
$(srcdir)/../convert.h
@@ -284,15 +284,15 @@ decl.o : decl.c $(CONFIG_H) $(CHILL_TREE
except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
$(srcdir)/../system.h $(srcdir)/../toplev.h
expr.o : expr.c $(CONFIG_H) $(RTL_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../tree.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
+ $(EXPR_H) $(srcdir)/../tree.h lex.h $(srcdir)/../system.h \
+ $(srcdir)/../toplev.h
grant.o: grant.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h lex.h actions.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h $(srcdir)/../output.h
inout.o : inout.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/../system.h $(srcdir)/../toplev.h
lang.o : lang.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../input.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
+ $(srcdir)/../system.h $(srcdir)/../toplev.h $(EXPR_H) $(RTL_H)
lex.o : lex.c $(CONFIG_H) $(CHILL_TREE_H) $(RTL_H) $(srcdir)/../flags.h \
$(srcdir)/../input.h $(srcdir)/parse.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h lex.h $(srcdir)/../dwarfout.h hash.h
diff -rup orig/egcs-CVS20000609/gcc/ch/lang.c egcs-CVS20000609/gcc/ch/lang.c
--- orig/egcs-CVS20000609/gcc/ch/lang.c Sat Jun 3 23:00:00 2000
+++ egcs-CVS20000609/gcc/ch/lang.c Sat Jun 10 18:56:24 2000
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA. */
#include "lex.h"
#include "input.h"
#include "toplev.h"
+#include "rtl.h"
+#include "expr.h"
/* Type node for boolean types. */
@@ -288,7 +290,7 @@ incomplete_type_error (value, type)
HOST_WIDE_INT
lang_get_alias_set (t)
- tree t;
+ tree t ATTRIBUTE_UNUSED;
{
/* ??? Need to figure out what the rules are. Certainly we'd need
to handle union-like things, and probably variant records.
diff -rup orig/egcs-CVS20000609/gcc/config/i386/i386.c egcs-CVS20000609/gcc/config/i386/i386.c
--- orig/egcs-CVS20000609/gcc/config/i386/i386.c Thu Jun 1 15:40:43 2000
+++ egcs-CVS20000609/gcc/config/i386/i386.c Sat Jun 10 19:38:38 2000
@@ -901,8 +901,8 @@ function_arg_advance (cum, mode, type, n
tree type; /* type of the argument or 0 if lib support */
int named; /* whether or not the argument was named */
{
- int bytes
- = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
+ int bytes =
+ (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
if (TARGET_DEBUG_ARG)
@@ -944,8 +944,8 @@ function_arg (cum, mode, type, named)
int named; /* != 0 for normal args, == 0 for ... args */
{
rtx ret = NULL_RTX;
- int bytes
- = (mode == BLKmode) ? int_size_in_bytes (type) : GET_MODE_SIZE (mode);
+ int bytes =
+ (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
switch (mode)
diff -rup orig/egcs-CVS20000609/gcc/config/i386/i386.h egcs-CVS20000609/gcc/config/i386/i386.h
--- orig/egcs-CVS20000609/gcc/config/i386/i386.h Mon May 8 20:10:00 2000
+++ egcs-CVS20000609/gcc/config/i386/i386.h Sat Jun 10 19:34:57 2000
@@ -2093,7 +2093,7 @@ while (0)
: (GET_MODE_SIZE (MODE)==2 \
? (IN ? ix86_cost->int_load[1] : ix86_cost->int_store[1]) \
: ((IN ? ix86_cost->int_load[2] : ix86_cost->int_store[2]) \
- * GET_MODE_SIZE (MODE) / 4))))
+ * (int) GET_MODE_SIZE (MODE) / 4))))
/* A C expression for the cost of a branch instruction. A value of 1
is the default; other values are interpreted relative to that. */
diff -rup orig/egcs-CVS20000609/gcc/cp/decl2.c egcs-CVS20000609/gcc/cp/decl2.c
--- orig/egcs-CVS20000609/gcc/cp/decl2.c Fri Jun 9 14:37:49 2000
+++ egcs-CVS20000609/gcc/cp/decl2.c Sat Jun 10 19:49:11 2000
@@ -581,7 +581,7 @@ compare_options (p1, p2)
const PTR p1;
const PTR p2;
{
- return strcmp (*((char **) p1), *((char **) p2));
+ return strcmp (*((const char *const *) p1), *((const char *const *) p2));
}
/* Decode the string P as a language-specific option.
diff -rup orig/egcs-CVS20000609/gcc/f/com.c egcs-CVS20000609/gcc/f/com.c
--- orig/egcs-CVS20000609/gcc/f/com.c Sat Jun 3 23:00:24 2000
+++ egcs-CVS20000609/gcc/f/com.c Sat Jun 10 19:01:00 2000
@@ -14875,7 +14875,7 @@ lang_identify ()
HOST_WIDE_INT
lang_get_alias_set (t)
- tree t;
+ tree t ATTRIBUTE_UNUSED;
{
/* We do not wish to use alias-set based aliasing at all. Used in the
extreme (every object with its own set, with equivalences recorded)
diff -rup orig/egcs-CVS20000609/gcc/ifcvt.c egcs-CVS20000609/gcc/ifcvt.c
--- orig/egcs-CVS20000609/gcc/ifcvt.c Sat Jun 3 22:59:48 2000
+++ egcs-CVS20000609/gcc/ifcvt.c Sat Jun 10 19:23:50 2000
@@ -307,8 +307,8 @@ cond_exec_process_if_block (test_bb, the
rtx test_expr; /* expression in IF_THEN_ELSE that is tested */
rtx then_start; /* first insn in THEN block */
rtx then_end; /* last insn + 1 in THEN block */
- rtx else_start; /* first insn in ELSE block or NULL */
- rtx else_end; /* last insn + 1 in ELSE block */
+ rtx else_start = NULL_RTX; /* first insn in ELSE block or NULL */
+ rtx else_end = NULL_RTX; /* last insn + 1 in ELSE block */
int max; /* max # of insns to convert. */
int then_mod_ok; /* whether conditional mods are ok in THEN */
rtx true_expr; /* test for else block insns */
diff -rup orig/egcs-CVS20000609/gcc/java/decl.c egcs-CVS20000609/gcc/java/decl.c
--- orig/egcs-CVS20000609/gcc/java/decl.c Wed May 31 22:34:01 2000
+++ egcs-CVS20000609/gcc/java/decl.c Sat Jun 10 19:05:38 2000
@@ -48,6 +48,7 @@ static tree push_promoted_type PARAMS ((
static struct binding_level *make_binding_level PARAMS ((void));
static boolean emit_init_test_initialization PARAMS ((struct hash_entry *,
hash_table_key));
+static tree create_primitive_vtable PARAMS ((const char *));
/* Set to non-zero value in order to emit class initilization code
before static field references. */
diff -rup orig/egcs-CVS20000609/gcc/java/jcf-write.c egcs-CVS20000609/gcc/java/jcf-write.c
--- orig/egcs-CVS20000609/gcc/java/jcf-write.c Thu Jun 1 10:19:33 2000
+++ egcs-CVS20000609/gcc/java/jcf-write.c Sat Jun 10 19:08:59 2000
@@ -2534,7 +2534,7 @@ generate_bytecode_insns (exp, target, st
NOTE_POP (1); /* Pop implicit this. */
if (TREE_CODE (f) == FUNCTION_DECL && DECL_CONTEXT (f) != NULL_TREE)
{
- tree saved_context;
+ tree saved_context = NULL_TREE;
int index, interface = 0;
RESERVE (5);
if (METHOD_STATIC (f))
diff -rup orig/egcs-CVS20000609/gcc/java/lang.c egcs-CVS20000609/gcc/java/lang.c
--- orig/egcs-CVS20000609/gcc/java/lang.c Sat Jun 3 23:00:31 2000
+++ egcs-CVS20000609/gcc/java/lang.c Sat Jun 10 19:04:36 2000
@@ -652,7 +652,7 @@ lang_print_xnode (file, node, indent)
HOST_WIDE_INT
lang_get_alias_set (t)
- tree t;
+ tree t ATTRIBUTE_UNUSED;
{
return -1;
}
diff -rup orig/egcs-CVS20000609/gcc/libgcc2.h egcs-CVS20000609/gcc/libgcc2.h
--- orig/egcs-CVS20000609/gcc/libgcc2.h Tue May 16 09:50:29 2000
+++ egcs-CVS20000609/gcc/libgcc2.h Sat Jun 10 19:14:25 2000
@@ -42,6 +42,8 @@ extern void __sjthrow (void) __attribute
extern void __sjpopnthrow (void) __attribute__ ((__noreturn__));
extern void __eprintf (const char *, const char *, unsigned int, const char *)
__attribute__ ((__noreturn__));
+extern void *__eh_alloc (size_t);
+extern void __eh_free (void *);
struct bb;
extern void __bb_exit_func (void);
diff -rup orig/egcs-CVS20000609/gcc/regrename.c egcs-CVS20000609/gcc/regrename.c
--- orig/egcs-CVS20000609/gcc/regrename.c Fri May 19 20:19:34 2000
+++ egcs-CVS20000609/gcc/regrename.c Sat Jun 10 19:19:20 2000
@@ -671,7 +671,7 @@ rr_replace_reg (x, reg_use, reg_sub, rep
replace_type, insn, status);
else if (replace_type == SOURCE)
{
- unsigned int dest_subregno;
+ unsigned int dest_subregno = 0;
int had_subreg = GET_CODE (SET_DEST (x)) == SUBREG;
if (had_subreg)