title: Why GCC generates strange way to move stack pointer
body: <p>I have observed that GCC's C++ compiler generates the following assembler code:</p>
  <pre><code>sub    $0xffffffffffffff80,%rsp
  </code></pre>
  <p>This is equivalent to</p>
  <pre><code>add    $0x80,%rsp
  </code></pre>
  <p>i.e. remove 128 bytes from the stack.</p>
  <p>Why does GCC generate the first sub variant and not the add variant? The add variant seems way more natural to me than to exploit that there is an underflow.</p>
  <p>This only occurred once in a quite large code base. I have no minimal C++ code example to trigger this. I am using GCC 7.5.0</p>