[ipxe-devel] compile fails with gcc 4.8.0

Michael Brown mbrown at fensystems.co.uk
Fri Jun 7 13:30:10 UTC 2013


On 07/06/13 14:22, Daniel P. Berrange wrote:
> This doesn't look right:
>
> -                                          "addw $4, %%sp\n\t" )
> +                                          "popl %%ebp\n\t" /* discard */
> +                                          "popl %%ebp\n\t" /* gcc bug */ )
>
> In the original patch it was
> -                                          "addw $4, %%sp\n\t" )
> +                                          "addw $4, %%sp\n\t"
> +                                          "popl %%ebp\n\t" )
>
> You've accidentally transposed the 'addw' into a second 'popl'.

That's deliberate: since %ebp is about to get overwritten anyway, we can 
use it as a discard register for the "popl", which increments %sp by 4 
using only two bytes of code rather than three.

You can see several other instances of this pattern within the codebase:

   git grep "pop.*discard"

Michael



More information about the ipxe-devel mailing list