Problem with __gmp_expr

Niels Möller nisse at
Sat Jan 18 15:31:36 UTC 2014

Marc Glisse <marc.glisse at> writes:

> Currently, we store references (pointers) to the
> arguments (except for builtin types like int or double), and in
> particular an expression can hold a reference to another expression
> that holds references to etc. This way each expression object is
> small. With the change, instead of having a reference to another
> expression, we know embed a copy of that other expression (only true
> GMP variables are not copied and still held by reference).

I was under the impression that these expression objects never exist at
run time, it's only a way to get the template machinery to generate the
right code? But then there are some problems if they are actually

> Expression objects can now be rather large, and we copy them around
> quite a bit. On the other hand, there are fewer indirections, which
> may be why my gcc liked it. Ideally, it shouldn't matter, the compiler
> should optimize all that away. In practice, it may not perfectly
> finish the job sometimes.

To me, optimizing the size of objects which normally shouldn't exist at
all at runtime, doesn't seem very important.


Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.

More information about the gmp-bugs mailing list