GNU bug report logs - #42147
28.0.50; pure vs side-effect-free, missing optimizations?

Previous Next

Package: emacs;

Reported by: Andrea Corallo <andrea_corallo <at> yahoo.it>

Date: Tue, 30 Jun 2020 22:28:02 UTC

Severity: normal

Found in version 28.0.50

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Andrea Corallo <akrl <at> sdf.org>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: Paul Eggert <eggert <at> cs.ucla.edu>, Stefan Monnier <monnier <at> iro.umontreal.ca>, Andrea Corallo <andrea_corallo <at> yahoo.it>, 42147 <at> debbugs.gnu.org
Subject: bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?
Date: Sun, 05 Jul 2020 13:16:13 +0000
Mattias Engdegård <mattiase <at> acm.org> writes:

> 4 juli 2020 kl. 18.13 skrev Andrea Corallo <andrea_corallo <at> yahoo.it>:
>
>> (defun bbb ()
>>   (let ((x (list 1 2)))
>>     (f x)        ; f is not pure
>>     (1+ (car x)) ; <= cannot optimize
>>     ))
>
> (A more precise property for 'f' in your examples would be 'side-effect-free' rather than 'pure'.)

Right good point!

>> BTW reading the code of the native compiler I realized I am already
>> extrapolating for use a very similar list of optimizable functions to the one
>> proposed.  I still think would quite cleaner to classify these in
>> byte-opt.el.
>
> Certainly, but be sure to state your criteria with clarity. There must be no doubt whether or not a function should have a certain property!

Absolutley, actually part of the scope of the patch in discussion (for
me) is exactly this given I'll just fetch this as a definition.

Thanks for improving the patch!

  Andrea

-- 
akrl <at> sdf.org




This bug report was last modified 4 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.