Illegal subtraction in tmp-dive_1.s

Torbjorn Granlund tg at
Thu Apr 16 10:45:12 CEST 2009

Dennis Clarke <dclarke at> writes:

  I hit this repeatedly on Solaris x86.
     289  .Lmovl_eip_ebp:
     290          movl    (%esp), %ebp
     291          ret
     292          .size   __gmp_binvert_limb_table,.-__gmp_binvert_limb_table
  What is the trick to getting around this ?

This is a bug with the way LEA works in mpn/x86/x86-def.m4.  The impact
is that the ".size" directive will be wrong for all asm files that use

When LEA is invoked, it defines EPILOGUE_cpu to contain some fixup code,
as well as the ".size" directive.  (If LEA is not invoked, ".size" is
generated by some default code, which works.)

The problem with the current code is that in mpn/x86/x86-def.m4, the $1
in the SIZE part gets its value already from LEA, not as intended from
the expansion of EPILOGUE later (EPILOGUE is defined in terms of
EPILOGUE_cpu in mpn/asm-def.m4).

It would be nice if some m4 hacker could look into this.  When you're at
it, please also generalize the LEA definition to handle multiple LEA
invocations, i.e., have it remember more than one movl_eip_blahblah.


More information about the gmp-discuss mailing list