This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] New SRA and early interprocedural SRA
- From: Jay Foad <jay dot foad at gmail dot com>
- To: mjambor at suse dot cz
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 3 Mar 2009 09:08:11 +0000
- Subject: Re: [RFC] New SRA and early interprocedural SRA
> If we moved dereferencing the NULL parameter to the caller we would
> have introduced a segfault in an application which did not suffer from
> it before. Therefore we have to examine whether on each path from cal
> to exit in the caller there is a dereferencing statement. We do this
> by going up the dominator tree from the exit block and looking whether
> there are any dereferences there.
Does that work even for functions that might never return?
int f (int *p) {
if (condition which is always true in practice)
while (true) {}
else
return *p;
}
Every path leading to a return dereferences p, but in practice f will
never dereference p.
Thanks,
Jay.