On Wed, May 29, 2019 at 10:39:54AM +0300, megane wrote: > Consider the case (= a b c). If the C_and in the rewrite short-circuits > then 'c' is never evaluated, right?
Ah, good observation. That might be a problem. > Testing this indicates this is not an issue. Playing with gcc > optimization flags didn't drop the evaluation of the 'c' node either. I don't understand. If you do (= 1 2 (error "hi")), it should raise the exception. Of course for "error" specifically it's not an issue because "error" is not inlineable. > I also tested that the lets in the rewrite can be dropped altogether. > The arguments are bound to variables by the CPS conversion anyway. > There's no duplicate evaluation. How do you enforce that? If there's an inlineable call it doesn't need to be bound to a variable. Something like (set! a 1) would be inlineable. > If you look at the output of -debug 5 you see that the next optimization > iteration drops the 'let's generated by the rewrite. You mean with the change you made? Cheers, Peter
signature.asc
Description: PGP signature
_______________________________________________ Chicken-hackers mailing list Chicken-hackers@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-hackers