This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Multiple set insns reload problem.


> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]