kripken/emscripten — Issue #160: Code does not function after optimization
Author: BrianJThomas
Created: 2012-01-05 02:52:00+00:00
State: open

The code I am compiling is here: http://codepad.org/cOVcXxtH
I am compiling using the following command: emcc forward.cpp -o forward.html -Wall -O1
The expected result is the following (compiled with clang): http://i.imgur.com/cc5sN.png
The generated html is: http://pastebin.com/D0GfJs6a
I am unfamiliar with git, but I think I am using emscripten with the git hash: cf1d3bf

The code functions without optimization as long as I increase TOTAL_STACK to a sufficient size (see Issue 159). However, with optimization, I get the following result in Chrome and Firefox: http://i.imgur.com/KYaVs.png

The code is from http://kevinbeason.com/smallpt/. I ported the non-recursive version to work with SDL and emscripten.