marcomaggi / vicare

A native compiler for Scheme compliant with R6RS
http://marcomaggi.github.com/vicare.html
Other
200 stars 34 forks source link

optimizer error in some case of R6RS record type constructor call #49

Closed marcomaggi closed 9 years ago

marcomaggi commented 11 years ago

Using the head of the devel branch (at least up to commit 6b24b402cc97e2322e766d2ac674e57c0f6a671f) it sometimes happens that calling an R6RS record constructor fails because the constructor function binding references #<void> rather than the function. In such cases the code fails with an error like:

*** Vicare: unhandled exception:
 Condition components:
   1. &assertion
   2. &who: apply
   3. &message: "not a procedure"
   4. &irritants: (#<void>)

This happens when the executable is run with options -O1, -O2, -O3 without debugging mode; it does not happen when using -O0 or turning on debugging mode. Notice that, by default, Vicare runs with -O2.

I am still working on finding a small example of code that reproduces this problem; in the meantime it is known that the package Industria (branch vicare-scheme) is affected by this problem.

The easy workaround is to run vicare with -O0; when configuring a package using the GNU Autotools (at least the ones packaged by me) we can do:

$ configure VFLAGS=-O0
marcomaggi commented 9 years ago

This should be fixed now in the head of the master branch.