I haven't been able to separate the code from my repo and make it still break, but I found what I imagine is an inlining bug when --enable-auto-force is enabled.
My repo: https://github.com/maitria/scheme-stuff.git
$ make $ gsi
(load "scheme-stuff.o1") (for-each pp (delay (cons 1 (delay (cons 2 '())))))
1 2>
Change lib/iteration.scm:14 and replace end-position? with null? and repeat:
(for-each pp (delay (cons 1 (delay (cons 2 '())))))
*** ERROR IN iteration#for-each -- (Argument 1) PAIR expected (car '()) 1>
The definition of end-position? is:
(define end-position? null?)
Adding an extraneous force call -- (loop (force (cdr position))) -- will prevent the problem.