On Wed, Jan 03, 2018 at 10:05:30AM +0100, Richard Biener wrote: > >One concern I have is that with the patch, malloc_candidate_p will > >return true if all the args to PHI are NULL: > >retval = PHI<0, 0> > >return retval > > > >However I expect that PHI with all 0 args would be constant folded to > >0 earlier, so this case shouldn't occur in practice ? > > You may not rely on folding for correctness.
Yeah. Will the patch handle (I mean punt on) also unfolded if (n) ? 0 : __builtin_malloc (n); and similar? Jakub