[Info-vax] Volatile, was: Re: yet another sys$qiow question

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Thu Aug 20 08:59:54 EDT 2015


On 2015-08-19, VAXman-  @SendSpamHere.ORG <VAXman- at SendSpamHere.ORG> wrote:
>
>     sp = (void *)asm("bis %r29,%r31,%r0;");	// get FP address                        

It doesn't apply here because you are using the output from the asm()
insert, but if you use an asm() insert in gcc that doesn't have any
obvious side effects, then the gcc optimiser can remove the asm insert.

You have to tell gcc what the side effects of the asm insert are so
the optimiser doesn't do something you don't want it to do. I generally
mark the asm statement as volatile and tell gcc it clobbers memory.

I mention this because I don't know what LLVM will do here.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world



More information about the Info-vax mailing list