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: [PATCH] Attribute noclone



I'm totally unconcerned with how __builtin_return_address is
"affected".  It's still doing its job properly.  I think it's
just our documentation that's unnecessarily alarmist.

Ah, I just grepped for noinline in the docs of course. So at least noclone should be mentioned in these places as well (or they should not be alarmist and do not mention noinline as well).

I think __b_r_a is the perfect example of when you want noinline but don't care about noclone. You just want to have a return address outside the function that calls __b_r_a, but you don't care if in a case like this:


char *pc[256];
void *__attribute__ ((noinline)) get_pc (int id)
{
  return (char *) __builtin_return_address (0) - pc[id];
}

... the id argument has been removed by the compiler.

That part of the documentation should be left as it is now.

Paolo


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