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: Jan Hubicka <hubicka at atrey dot karlin dot mff dot cuni dot cz>
- Subject: Re: Multiple set insns reload problem.
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 11 Jan 2000 22:45:30 +0000 (GMT)
- 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
> 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.