This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Multiple set insns reload problem.
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Re: Multiple set insns reload problem.
- From: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Date: Wed, 12 Jan 2000 14:05:55 +0100
- Cc: egcs at egcs dot cygnus dot com, bernds at pasanda dot cygnus dot co dot uk, egcs-bugs at egcs dot cygnus dot com
- References: <20000111185703.A17675@atrey.karlin.mff.cuni.cz> <200001112245.WAA11385@phal.cygnus.co.uk>
> > int a;
> > main()
> > {
> > int *ptr=&a;
> > asm("":"=r"(ptr):"0"(&a)); /* Hide the constant address behind cse */
> > asm("movl $0,%0 ; movl $0,%1":"=m,r"(*ptr),"=,c"(ptr));
>
> I think you invoke undefined behaviour here, because you are updating
> ptr in the same insn as you use it as address in a separate upadte, and
> there is no sequence point between the updates.
OK
If this is expected to be undefined so there is probably no problem.
But is this mentioned somewhere in the documentation?
I can't find it in the asm statements section where it IMO ought to
be mentioned.
I believe that such situation may happen with real inline functions
unsing asm statements if you pass clever parameters to it.
Honza