This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Can shrink-wrapping ever move prologue past an ASM statement?
- From: Josh Poimboeuf <jpoimboe at redhat dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>, Vojtech Pavlik <vojtech at suse dot cz>
- Date: Wed, 8 Jul 2015 15:51:12 -0500
- Subject: Re: Can shrink-wrapping ever move prologue past an ASM statement?
- Authentication-results: sourceware.org; auth=none
- References: <20150707175349 dot GA2325 at virgil dot suse dot cz> <20150707184415 dot GB13004 at gate dot crashing dot org> <20150708092309 dot GB2325 at virgil dot suse dot cz> <20150708103631 dot GA23975 at gate dot crashing dot org> <20150708162234 dot GB4687 at treble dot redhat dot com>
On Wed, Jul 08, 2015 at 11:22:34AM -0500, Josh Poimboeuf wrote:
> On Wed, Jul 08, 2015 at 05:36:31AM -0500, Segher Boessenkool wrote:
> > On Wed, Jul 08, 2015 at 11:23:09AM +0200, Martin Jambor wrote:
> > > > For other archs, e.g. x86-64, you can do
> > > >
> > > > register void *sp asm("%sp");
> > > > asm volatile("call func" : "+r"(sp));
I've found that putting "sp" in the clobber list also seems to work:
asm volatile("call func" : : : "sp");
This syntax is nicer because it doesn't need a local variable associated
with the register. Do you see any issues with this approach?
--
Josh