type checking and source-transforms

Bug #309104 reported by Nikodemus Siivola on 2008-12-17
Affects Status Importance Assigned to Milestone

Bug Description

    (block nil (let () (funcall #'+ (eval 'nil) (eval '1) (return :good))))
  signals type error.

  Our policy is to check argument types at the moment of a call. It
  disagrees with ANSI, which says that type assertions are put
  immediately onto argument expressions, but is easier to implement in
  IR1 and is more compatible to type inference, inline expansion,
  etc. IR1-transforms automatically keep this policy, but source
  transforms for associative functions (such as +), being applied
  during IR1-convertion, do not. It may be tolerable for direct calls
  (+ x y z), but for (FUNCALL #'+ x y z) it is non-conformant.

  b. Another aspect of this problem is efficiency. [x y + z +]
  requires less registers than [x y z + +]. This transformation is
  currently performed with source transforms, but it would be good to
  also perform it in IR1 optimization phase.

Changed in sbcl:
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers