Comment 5 for bug 309125

Revision history for this message
Christophe Rhodes (csr21-cantab) wrote :

This has been making me sad.

Firstly, updated patch is attached; it should apply, but it is hand-edited.

Secondly, some of the test cases fail, in surprising ways. In particular, one which fails is

(defun foo (x)
  (declare (optimize speed (safety 1)) (type (and simple-bit-vector (satisfies undefined)) x)
  (elt x 5))

(foo #*101010) ; see :bug-316078 in tests/compiler.pure.lisp

where what we assume happens is that the hairy type test is weakened by the speed-3/safety-1 policy, and this no longer happens.

The semantics of mixing type and policy declarations is not 100% clear, but the way ANSI explains type declarations as being equivalent to inserting THE forms in the body (including at the head of the body) suggests to me that the test is correct and the new semantics are wrong, for this case. I have not been able to adjust the compiler to implement what I think are the correct semantics, however.