Subject: Re: bug#62537: Error compiling emacs master with native compilation activated

From: Mattias Engdegård <[email-masked]>
Date: Wed, 5 Apr 2023 22:51:01 +0200

5 apr. 2023 kl. 19.19 skrev Andrea Corallo <[email-masked]>:

> As we suspected was a bug in the native compiler limplification pass
> triggered by the new LAP emitted.
> 
> fa669c4b17c fixes bootstrap --with-native-compilation=aot here and adds
> a test, is now pushed to master.  In 29 the bug never showed up
> (probably because the new LAP tweak is not it) so I guess it's better to
> leave the code as it is.

Nice! So the bug was that we optimised away switches where all jump targets are the same, without considering the fall-through case?

(Perhaps we should do something like that in the LAP optimiser. Wonder how common the opportunity is though.)

By the way, the bulk of `comp-jump-table-optimizable` should be equivalent to something like

   (apply #'= (hash-table-values jmp-table))

which is arguably clearer and definitely shorter.