optimizationemscripten

Is using -O3 with emscripten considered safe?


Older version of emscripten (i.e. pre fastcomp) when run with the -O3 flag spewed the following warning:

WARNING : Applying some potentially unsafe optimizations! (Use -O2 if this fails.)

However, newer versions when run with -O3 don't warn at all.

Does this mean that using -O3 is now safe?


Solution

  • Yes, it is safe. It runs some slower but more powerful optimizations than -O2, but none of them are unsafe. See emcc --help for more details on what it does.