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: PR 22051



On Jun 25, 2005, at 1:37 PM, Jeffrey A Law wrote:


Shouldn't VRP handle this testcase instead?
No.  It's really not the kind of thing VRP is supposed to handle.
I initially thought it might be as well, but it's really better
handled by a tree combiner or a copy propagation pass which
understands casts.

Why do you say that? Look at this testcase: foo(int n) { int *space = (int *)__builtin_alloca (n);

  if (space == 0)
    abort ();
  else
    bar (space);
}

VRP should know that alloca returns nonnull and then space's range
becomes non null.  Right now I think VRP does not know alloca returns
non-null which causes the bug.

-- Pinski


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