aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-10-09 15:26:46 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-10-09 15:26:46 -0400
commit7e5d2a672c8ad58cb20fbd4d10e2729851da39be (patch)
treeba2e21257aef176a0583f55d1c21b50188db657e
parentce14f4f22d4dbfa0feed2e22bb5ba9a6defaa823 (diff)
use aliasing function pointers in -O1
-rwxr-xr-xemcc12
-rw-r--r--tests/test_core.py4
-rw-r--r--tools/shared.py1
3 files changed, 10 insertions, 7 deletions
diff --git a/emcc b/emcc
index 3b068702..f8d7319e 100755
--- a/emcc
+++ b/emcc
@@ -132,15 +132,15 @@ Options that are modified or new in %s include:
optimizations, relooping, and no runtime assertions
or C++ exception catching (to re-enable
C++ exception catching, use
- -s DISABLE_EXCEPTION_CATCHING=0 ).
- (For details on the affects of different
- opt levels, see apply_opt_level() in
- tools/shared.py and also src/settings.js.)
- -O2 As -O1, plus various js-level optimizatios,
- LLVM -O3 optimizations, and
+ -s DISABLE_EXCEPTION_CATCHING=0 ), and enables
-s ALIASING_FUNCTION_POINTERS=1
+ (For details on the affects of different
+ opt levels, see apply_opt_level() in
+ tools/shared.py and also src/settings.js.)
+ -O2 As -O1, plus various js-level optimizations and
+ LLVM -O3 optimizations
-O3 As -O2, plus dangerous optimizations that may
break the generated code! This adds
diff --git a/tests/test_core.py b/tests/test_core.py
index 03fd4d56..f0c94170 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -8655,6 +8655,10 @@ void*:16
if Settings.QUANTUM_SIZE == 1: return self.skip('TODO: Figure out and try to fix')
if Settings.ASM_JS and '-O2' not in self.emcc_args: return self.skip('mozilla bug 863867')
+ assert 'asm2g' in test_modes
+ if self.run_name == 'asm2g':
+ Settings.ALIASING_FUNCTION_POINTERS = 1 - Settings.ALIASING_FUNCTION_POINTERS # flip for some more coverage here
+
if Settings.CORRECT_SIGNS == 0: Settings.CORRECT_SIGNS = 1 # Not sure why, but needed
post = '''
diff --git a/tools/shared.py b/tools/shared.py
index 63397f98..c816f091 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -759,7 +759,6 @@ class Settings2(type):
self.attrs['ASSERTIONS'] = 0
self.attrs['DISABLE_EXCEPTION_CATCHING'] = 1
self.attrs['RELOOP'] = 1
- if opt_level >= 2:
self.attrs['ALIASING_FUNCTION_POINTERS'] = 1
if opt_level >= 3:
# Aside from these, -O3 also runs closure compiler and llvm lto