This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Uninitialised memory read in gcc-2.95.2/gcc/lcm.c, another one
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Uninitialised memory read in gcc-2.95.2/gcc/lcm.c, another one
- From: Martin Stromberg <Martin dot Stromberg at lu dot erisoft dot se>
- Date: Sun, 12 Mar 2000 16:42:43 +0100 (MET)
After allocating with sbitmap_vector_alloc(), it seems you're supposed
to initialise what has been allocated as sbitmap_vector_alloc()
doesn't.
gcc-2.95.2/gcc/lcm.c misses that at line 427.
Patch:
diff -ru gcc-2.95.2.org/gcc/lcm.c gcc-2.95.2/gcc/lcm.c
--- gcc-2.95.2.org/gcc/lcm.c Wed Mar 10 23:03:35 1999
+++ gcc-2.95.2/gcc/lcm.c Sun Mar 12 15:12:58 2000
@@ -424,6 +424,7 @@
/* This is constant throughout the flow equations below, so compute
it once to save time. */
anti_and_early = sbitmap_vector_alloc (n_blocks, n_exprs);
+ sbitmap_vector_zero (anti_and_early, n_exprs);
for (bb = 0; bb < n_blocks; bb++)
sbitmap_a_and_b (anti_and_early[bb], antin[bb], earlyin[bb]);
U2, October,
MartinS