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 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 carry

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 d...@limegreensocks.com wrote: On 11/13/2014 6:02 AM, Richard Biener wrote: On Thu, Nov 13, 2014 at 2:53 PM, Hans-Peter Nilsson h...@bitrange.com wrote: On Thu, 13 Nov 2014, David Wohlferd wrote: Sorry for the (very) delayed response. I'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

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 d...@limegreensocks.com 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

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 h...@bitrange.com 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

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

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 d...@limegreensocks.com 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.

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

2014-10-03 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-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 investigation.

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 d...@limegreensocks.com wrote: Hans-Peter Nilsson: I should have listened to you back when you raised concerns about this. My apologies for ever doubting

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 d...@limegreensocks.com 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 d...@limegreensocks.com wrote: Hans-Peter Nilsson: I should have

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 d...@limegreensocks.com 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

[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

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 d...@limegreensocks.com 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