Re: Spurious register spill with volatile function argument

2016-03-28 Thread Florian Weimer
* Paul Koning: >> On Mar 28, 2016, at 8:11 AM, Florian Weimer wrote: >> >> ... >> The problem is that “reading” is either not defined, or the existing >> flatly contradicts existing practice. >> >> For example, if p is a pointer to a struct, will the expression &p->m >> read *p? > > Presumably

Re: Spurious register spill with volatile function argument

2016-03-28 Thread Paul_Koning
> On Mar 28, 2016, at 8:11 AM, Florian Weimer wrote: > > ... > The problem is that “reading” is either not defined, or the existing > flatly contradicts existing practice. > > For example, if p is a pointer to a struct, will the expression &p->m > read *p? Presumably the offset of m is substan

Re: Spurious register spill with volatile function argument

2016-03-28 Thread Florian Weimer
* Andrew Haley: > "volatile" doesn't really mean very much, formally speaking. Sure, the > standard says "accesses to volatile objects are evaluated > strictly according to the rules of the abstract machine," but nowhere > is it specified exactly what constitutes an access. Reading or modifying

Re: Spurious register spill with volatile function argument

2016-03-28 Thread Andrew Haley
On 27/03/16 06:57, Michael Clark wrote: > GCC, Clang folk, any ideas on why there is a stack spill for a > volatile register argument passed in esi? Does volatile force the > argument to have storage allocated on the stack? Is this a corner > case in the C standard? This argument in the x86_64 cal

Spurious register spill with volatile function argument

2016-03-26 Thread Michael Clark
Seems I had misused volatile. I removed ‘volatile’ from the function argument on test_0 and it prevented the spill through the stack. I added volatile because I was trying to avoid the compiler optimising away the call to test_0 (as it has no side effects) but it appeared that volatile was unne