|
From: | Gregory Heytings |
Subject: | Re: Add more supported primitives in libgccjit IR (was: Shrinking the C core) |
Date: | Mon, 21 Aug 2023 12:33:15 +0000 |
Take this equally trivial example: (setq a most-positive-fixnum) (setq a (1+ a)) The 'a' object was an integer, and became a bignum.I understand. I doubt that Emacs native compiler checks this far. However, such checks are definitely doable - integer bounds are not unknown and can certainly be handled.
They cannot, certainly not in general. In the trivial example above the compiler could know that 'a' is most-positive-fixnum. But if you have a '1+' somewhere in an actual piece of code, you cannot, except in rare cases, know at compile time its argument (whose value may, for example, depend on the value of a function argument) is an integer and that adding 1 to that integer will not overflow.
[Prev in Thread] | Current Thread | [Next in Thread] |