This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch: used uninitialized warnings {expr,reload1,sched-deps}.c
- To: gcc-patches at gcc dot gnu dot org
- Subject: Patch: used uninitialized warnings {expr,reload1,sched-deps}.c
- From: RDBrown at mira dot net
- Date: Mon, 19 Mar 2001 22:19:26 +1100 (EST)
- Reply-To: RDBrown at mira dot net,RodneyBrown at mynd dot com
Remove `might be used uninitialized in this function' warnings,
no regressions on i586-sco-sysv5uw7.1.0.
stage2/xgcc -Bstage2/ -B/usr/local/i586-sco-sysv5uw7.1.0/bin/ -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../gcc-20010312/gcc -I../../gcc-20010312/gcc/. -I../../gcc-20010312/gcc/config -I../../gcc-20010312/gcc/../include ../../gcc-20010312/gcc/expr.c -o expr.o
-../../gcc-20010312/gcc/expr.c: In function `store_constructor':
-../../gcc-20010312/gcc/expr.c:4583: warning: `minelt' might be used uninitialized in this function
-../../gcc-20010312/gcc/expr.c:4584: warning: `maxelt' might be used uninitialized in this function
../../gcc-20010312/gcc/reload1.c:625: warning: comparison between signed and unsigned
../../gcc-20010312/gcc/reload1.c: In function `reload_combine':
../../gcc-20010312/gcc/reload1.c:8818: warning: comparison between signed and unsigned
-../../gcc-20010312/gcc/reload1.c:8582: warning: `last_index_reg' might be used uninitialized in this function
stage2/xgcc -Bstage2/ -B/usr/local/i586-sco-sysv5uw7.1.0/bin/ -c -DIN_GCC -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I. -I../../gcc-20010312/gcc -I../../gcc-20010312/gcc/. -I../../gcc-20010312/gcc/config -I../../gcc-20010312/gcc/../include ../../gcc-20010312/gcc/sched-deps.c -o sched-deps.o
-../../gcc-20010312/gcc/sched-deps.c: In function `add_dependence':
-../../gcc-20010312/gcc/sched-deps.c:200: warning: `present_dep_type' might be used uninitialized in this function
2001-03-19 Rodney Brown <RodneyBrown@mynd.com>
Remove `might be used uninitialized' warnings.
* expr.c (store_constructor): Initialize minelt, maxelt.
* reload1.c (reload_combine): Initialize last_index_reg.
* sched-deps.c (add_dependence): Initialize present_dep_type.
--- expr.c.orig Wed Mar 7 10:34:16 2001
+++ expr.c Mon Mar 19 10:41:27 2001
@@ -4580,8 +4580,8 @@ store_constructor (exp, target, align, c
tree elttype = TREE_TYPE (type);
int const_bounds_p = (host_integerp (TYPE_MIN_VALUE (domain), 0)
&& host_integerp (TYPE_MAX_VALUE (domain), 0));
- HOST_WIDE_INT minelt;
- HOST_WIDE_INT maxelt;
+ HOST_WIDE_INT minelt = 0;
+ HOST_WIDE_INT maxelt = 0;
/* If we have constant bounds for the range of the type, get them. */
if (const_bounds_p)
--- reload1.c.orig Fri Mar 16 10:51:08 2001
+++ reload1.c Mon Mar 19 10:40:46 2001
@@ -8579,7 +8579,7 @@ static void
reload_combine ()
{
rtx insn, set;
- int first_index_reg = -1, last_index_reg;
+ int first_index_reg = -1, last_index_reg = -1;
int i;
unsigned int r;
int last_label_ruid;
--- sched-deps.c.orig Tue Jan 23 14:12:04 2001
+++ sched-deps.c Mon Mar 19 10:33:58 2001
@@ -197,7 +197,6 @@ add_dependence (insn, elem, dep_type)
{
rtx link, next;
int present_p;
- enum reg_note present_dep_type;
rtx cond1, cond2;
/* Don't depend an insn on itself. */
@@ -271,6 +270,8 @@ add_dependence (insn, elem, dep_type)
dramatically for some code. */
if (true_dependency_cache != NULL)
{
+ enum reg_note present_dep_type = 0;
+
if (anti_dependency_cache == NULL || output_dependency_cache == NULL)
abort ();
if (TEST_BIT (true_dependency_cache[INSN_LUID (insn)], INSN_LUID (elem)))