This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Reenable CSE of non-volatile inline asm (PR rtl-optimization/63637)
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Richard Biener <rguenther at suse dot de>, Eric Botcazou <ebotcazou at adacore dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 Jan 2015 18:03:15 -0600
- Subject: Re: [PATCH] Reenable CSE of non-volatile inline asm (PR rtl-optimization/63637)
- Authentication-results: sourceware.org; auth=none
- References: <20150113161819 dot GD1405 at tucnak dot redhat dot com> <20150113163840 dot GA4183 at gate dot crashing dot org> <54B575D7 dot 8030107 at redhat dot com> <20150113201322 dot GJ1405 at tucnak dot redhat dot com> <54B59964 dot 7070707 at redhat dot com>
On Tue, Jan 13, 2015 at 03:17:08PM -0700, Jeff Law wrote:
> >And finally there is the case of non-volatile asm with "memory" clobber
> >with
> >no memory stores in between the two - the posted (safer) patch will not
> >allow to CSE the two, while in theory we could CSE them into just one asm.
> I think we have to assume that CSEing them is wrong. The first may set
> something in memory that is read by the second.
>
> Thoughts?
I agree with pretty much everything you say in the thread, except for this
idea that a memory clobber reads memory. No clobber reads anything.
The commit that introduced the memory clobber concept, 426b38c9 (svn 1207),
by rms, has as only comment
/* `memory', don't cache memory across asm */
Segher