This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: tree ssa and type issues
On Sat, 2005-05-21 at 20:33 +0200, Gabriel Dos Reis wrote:
> Andreas Jaeger <aj@suse.de> writes:
>
> | Gabriel Dos Reis <gdr@integrable-solutions.net> writes:
> |
> | > Hi again,
> | >
> | > I just hit this one from tree-ssa-into.c:rewrite_into_ssa()
> | >
> | > /* Initialize dominance frontier. */
> | > dfs = (bitmap *) xmalloc (last_basic_block * sizeof (bitmap *));
> | > ^^^^^^^^
> | >
> | > If the sizeof operand really supposed to be "bitmap*" and not "bitmap"?
> |
> | This indeed looks wrong - and could lead to real memory corruption
> | :-(. If this is wrong, he should be changed on the 4.0 branch as
> | well,
>
> And if it is wrong, it would be interesting to know wheter we already
> have PRs related to that memory corruption -- but I guess it would be
> hard to know :-)
Again, it won't corrupt memory, because sizeof (bitmap *) == sizeof
(bitmap), though it is still wrong.
>
> Parenthetically, I was wondering who is freeing those extensive
> regions of storage xmalloc/xcalloc()ed here and there?
1. The people who write the code to do the xmalloc'ing.
2. Every couple of months, people run gcc through valgrind with leak
checking on to make sure we arne't leaking the xmalloc'd memory.