https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109484
--- Comment #5 from 。 <570070308 at qq dot com> --- (In reply to Richard Biener from comment #3) > (In reply to 。 from comment #2) > > (In reply to Richard Biener from comment #1) > > > but you clobber 'temp' early and fail to indicate that so GCC allocates > > > the > > > same register as part of the "+m" output. > > > > The requirements you describe are not reflected in the documentation. The > > document only says that `GCC assumpts that the assembler code consumes its > > inputs before producing outputs`, and this code fits the assumption. First, > > it reads the input from %1, then write the output to %0, then write the > > output to %1. No outputs happend before inputs. > > You first write to 'temp' and then read from it. The wording applies to the > assigned register / address, _not_ to the C variables mapped. > > Note I'm not an expert here and I wonder if an output operand is the > appropriate > way to create a scratch register for arbitrary use. The second instruction is $0, not %0.