title: When to use earlyclobber constraint in extended GCC inline assembly?
body: <p>I understand when to use a cobbler list (e.g. listing a register which is modified in the assembly so that it doesn't get chosen for use as an input register, etc), but I can't wrap my head around the the earlyclobber constraint <code>&amp;</code>. If you list your outputs, wouldn't that already mean that inputs can't use the selected register (aside from matching digit constraints)?</p>
  <p>For example:</p>
  <pre><code>asm(
      &quot;movl $1, %0;&quot;
      &quot;addl $3, %0;&quot;
      &quot;addl $4, %1;&quot;   // separate bug: modifies input-only operand
      &quot;addl %1, %0;&quot;
      : &quot;=g&quot;(num_out)
      : &quot;g&quot;(num_in)
      :
  );
  </code></pre>
  <p>Would <code>&amp;</code> even be needed for the output variables? The compiler should know the register that was selected for the output, and thus know not to use it for the input.</p>