This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]