Hi,

On Wed, 6 Feb 2013, Richard Biener wrote:

> realloc can also effectively free memory.  But the above no longer
> considers free () a freeing call as well?!

free is not ECF_LEAF, so is handled correctly, like tm_free.  I didn't 
consider realloc, it's indeed not handled.

> That said, please enumerate freeing builtins even if they are not 
> ECF_LEAF at the moment - they might become such I suppose (realloc is 
> LEAF, free is not) - curiously there is no __builtin_in_tm_realloc.

The function now reads:

--------------
static bool
nonfreeing_call_p (gimple call)
{
  if (gimple_call_builtin_p (call, BUILT_IN_NORMAL)
      && gimple_call_flags (call) & ECF_LEAF)
    switch (DECL_FUNCTION_CODE (gimple_call_fndecl (call)))
      {
        /* Just in case these become ECF_LEAF in the future.  */
        case BUILT_IN_FREE:
        case BUILT_IN_TM_FREE:
        case BUILT_IN_REALLOC:
        case BUILT_IN_STACK_RESTORE:
          return false;
        default:
          return true;
      }

  return false;
}
--------------

Testcase and hmmer work, okay after regstrapping?


Ciao,
Michael.

Reply via email to