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: [tree-ssa] Fix PR/12187


In message <1065656835.7088.118.camel@frodo.toronto.redhat.com>, Diego Novillo 
writes:
 >
 >call-clobbered only when calling a nested function, but according to rth
 >that will have problems because it is possible to take the address of a
 >nested function and call it from somewhere else.
Yes, but that is only valid if the function containing the nested function
still has an active stack frame at the time of the call.  ie you can't
do something like



foo ()
{
  bar ()
    {
      ...
    }

  blah = bar;
}

dangerous()
{
  (*blah) (args);
}


main()
{
  foo();
  dangerous();
}



Jeff


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