constant-folding doesn't work for not self-evaluating values

When result may be constant-folded it is transformed into (values ,@vals), what works just fine if vals are self evaluating types, i.e (values 1 2 :b "jam"), but it doesn't work for i.e (values (1 . 2) 42). Regression introduced in 209434f9

(LET ((FORM
             '(LAMBDA (A)
                (DECLARE (TYPE (INTEGER -125 -44) A))
                (DECLARE (IGNORABLE A))
                (DECLARE
                 (OPTIMIZE (SPEED 0) (DEBUG 0) (SPACE 2) (COMPILATION-SPEED 3)
                  (SAFETY 3)))
                (MASK-FIELD (BYTE 0 0)
                            (BLOCK B3
                              (ISQRT (ABS (CATCH 'CT2 (RETURN-FROM B3 0)))))))))
        (FUNCALL (COMPILE NIL FORM) -50))

I'm working on a fix right now. The solution should resort to old behavior when there is one value and otherwise return (values ,@constants) - constant expressions may be inlined in code, while simply (values ,@results) not so much (I think!).

Assignee Loading
Time tracking Loading