Actually, optimizer produces faulty code for main.d, not for jsvar.d. it's ok to compile jsvar.d with -O2, but main.d with -O2 will segfault.