Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-15 Thread David Wohlferd
Can you please file a bug in bugzilla if you haven't already done so? We can still fix bugs during the next three months ;) Well, I opened one. Briefly. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63900 dw

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-14 Thread Richard Biener
On Fri, Nov 14, 2014 at 12:51 AM, David Wohlferd wrote: > > On 11/13/2014 6:02 AM, Richard Biener wrote: >> >> On Thu, Nov 13, 2014 at 2:53 PM, Hans-Peter Nilsson >> wrote: >>> >>> On Thu, 13 Nov 2014, David Wohlferd wrote: Sorry for the (very) delayed response. I'm still looking for

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-14 Thread Segher Boessenkool
On Thu, Nov 13, 2014 at 01:14:41PM +0100, Richard Biener wrote: > It might be that RTL alias analysis / CSE give up too early here > (we don't optimize across asm() on the GIMPLE level at all ... heh). > > I didn't look where it gives up (even though appearantly it does). The cse1 pass doesn't ca

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread dw
I've forgot if someone mentioned whether we have a test-case in our test-suite for this feature. I'm looking thru gcc/testsuite/*.c to see if I can spot anything. It's not easy since there is a lot of asm and the people who write these are apparently allergic to using comments to describe wh

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread David Wohlferd
On 11/13/2014 6:02 AM, Richard Biener wrote: On Thu, Nov 13, 2014 at 2:53 PM, Hans-Peter Nilsson wrote: On Thu, 13 Nov 2014, David Wohlferd wrote: Sorry for the (very) delayed response. I'm still looking for feedback here so I can fix the docs. Thank you for your diligence. As I said befo

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread Richard Biener
On Thu, Nov 13, 2014 at 2:53 PM, Hans-Peter Nilsson wrote: > On Thu, 13 Nov 2014, David Wohlferd wrote: >> Sorry for the (very) delayed response. I'm still looking for feedback here >> so >> I can fix the docs. > > Thank you for your diligence. > >> As I said before, triggering a full memory clo

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread Hans-Peter Nilsson
On Thu, 13 Nov 2014, David Wohlferd wrote: > Sorry for the (very) delayed response. I'm still looking for feedback here so > I can fix the docs. Thank you for your diligence. > As I said before, triggering a full memory clobber for anything over 16 bytes > (and most sizes under 16 bytes) makes t

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread Richard Biener
On Thu, Nov 13, 2014 at 1:03 PM, David Wohlferd wrote: > Sorry for the (very) delayed response. I'm still looking for feedback here > so I can fix the docs. > > To refresh: The topic of conversation was the (extremely) wrong explanation > that has been in the docs since forever about how to use m

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-11-13 Thread David Wohlferd
Sorry for the (very) delayed response. I'm still looking for feedback here so I can fix the docs. To refresh: The topic of conversation was the (extremely) wrong explanation that has been in the docs since forever about how to use memory constraints with inline asm to avoid the performance hi

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-10-06 Thread Richard Biener
On Fri, Oct 3, 2014 at 8:41 AM, David Wohlferd wrote: > >> You want >> >> "=m" (*( struct foo { char x[8]; } __attribute__((may_alias)) *)Dest) > > > Thank you. With your help, that worse-than-useless sample in the docs is > getting closer to something people can actually use. > > Except for one

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-10-03 Thread Hans-Peter Nilsson
On Thu, 2 Oct 2014, David Wohlferd wrote: > > You want > > > > "=m" (*( struct foo { char x[8]; } __attribute__((may_alias)) *)Dest) > > Thank you. With your help, that worse-than-useless sample in the docs > is getting closer to something people can actually use. Thank *you* for your investigat

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-10-02 Thread David Wohlferd
You want "=m" (*( struct foo { char x[8]; } __attribute__((may_alias)) *)Dest) Thank you. With your help, that worse-than-useless sample in the docs is getting closer to something people can actually use. Except for one last serious problem: This trick only works for very specific (and

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-09-26 Thread Richard Biener
On Fri, Sep 26, 2014 at 12:37 PM, David Wohlferd wrote: > > On 9/25/2014 12:36 AM, Yury Gribov wrote: >> >> On 09/24/2014 12:31 PM, Richard Biener wrote: >>> >>> On Wed, Sep 24, 2014 at 9:43 AM, David Wohlferd >>> wrote: Hans-Peter Nilsson: I should have listened to you back when you r

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-09-26 Thread David Wohlferd
On 9/25/2014 12:36 AM, Yury Gribov wrote: On 09/24/2014 12:31 PM, Richard Biener wrote: On Wed, Sep 24, 2014 at 9:43 AM, David Wohlferd wrote: Hans-Peter Nilsson: I should have listened to you back when you raised concerns about this. My apologies for ever doubting you. In summary: - The "

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-09-25 Thread Yury Gribov
On 09/24/2014 12:31 PM, Richard Biener wrote: On Wed, Sep 24, 2014 at 9:43 AM, David Wohlferd wrote: Hans-Peter Nilsson: I should have listened to you back when you raised concerns about this. My apologies for ever doubting you. In summary: - The "trick" in the docs for using an arbitrarily

Re: [RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-09-24 Thread Richard Biener
On Wed, Sep 24, 2014 at 9:43 AM, David Wohlferd wrote: > Hans-Peter Nilsson: I should have listened to you back when you raised > concerns about this. My apologies for ever doubting you. > > In summary: > > - The "trick" in the docs for using an arbitrarily sized struct to force > register flushe

[RFD] Using the 'memory constraint' trick to avoid memory clobber doesn't work

2014-09-24 Thread David Wohlferd
Hans-Peter Nilsson: I should have listened to you back when you raised concerns about this. My apologies for ever doubting you. In summary: - The "trick" in the docs for using an arbitrarily sized struct to force register flushes for inline asm does not work. - Placing the inline asm in a sep