https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93583

--- Comment #14 from Martin Liška <marxin at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #12)
> void *bar(const char*);
> static void *__attribute__((malloc,noinline)) foo(const char *p)
> {
>   return bar (p);
> }
> 
> int main(int argc, char **argv)
> {
>   foo (argv[0]);
>   return 0;
> }
> 
> 
> doesn't ICE on x86_64

In this testcase you don't have foo being transformed to void function:

gcc malloc.c -c -O2 -fdump-tree-optimized=/dev/stdout

;; Function foo (foo, funcdef_no=0, decl_uid=1913, cgraph_uid=1,
symbol_order=0) (executed once)

__attribute__((noinline, malloc))
foo (const char * p)
{
  void * _4;

  <bb 2> [local count: 1073741824]:
  _4 = bar (p_2(D)); [tail call]
  return _4;

}

Reply via email to