Multiple set insns reload problem.
Jan Hubicka
hubicka@atrey.karlin.mff.cuni.cz
Wed Jan 12 05:06:00 GMT 2000
> > 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
More information about the Gcc-bugs
mailing list