Re: who owns stack args?

2016-02-24 Thread Jeff Law
On 02/24/2016 01:42 PM, Alexander Monakov wrote: On Wed, 24 Feb 2016, DJ Delorie wrote: The real question is: are stack arguments call-clobbered or call-preserved? Does the answer depend on the "pure" attribute? Stack area holding stack arguments should belong to the callee for tail-calls to

Re: who owns stack args?

2016-02-24 Thread Alexander Monakov
On Wed, 24 Feb 2016, DJ Delorie wrote: > The real question is: are stack arguments call-clobbered or > call-preserved? Does the answer depend on the "pure" attribute? Stack area holding stack arguments should belong to the callee for tail-calls to work (the callee will trash that area when laying

who owns stack args?

2016-02-24 Thread DJ Delorie
Consider this example (derived from gcc.c-torture/execute/920726-1.c): extern int a(int a, int b, int c, int d, int e, int f, const char *s1, const char *s2) __attribute__((pure)); int foo() { if (a(0,0,0,0,0,0,"abc","def") || a(0,0,0,0,0,0,"abc","ghi")) return 0; return 1