Permalink
Browse files

Fix for LLVM optimization bug. LLVM, in release mode for 64 bit optim…

…izes out local variables that shouldn't be optimized out. We need to mark them as volatile so that the optimizer will leave them alone. This fixes the test case supplied here f9485a2#commitcomment-20389321 regarding the previous fix that didn't completely solve the issue f9485a2

Related issues #1701
#1834
  • Loading branch information...
1 parent f9485a2 commit 593b6777b998e6f1fe98638d405e88e69cb6a40f @shannah shannah committed Jan 6, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 vm/ByteCodeTranslator/src/com/codename1/tools/translator/BytecodeMethod.java
@@ -463,7 +463,7 @@ public void appendMethodC(StringBuilder b) {
String variableName = lv.getQualifier() + "locals_"+lv.getIndex()+"_";
if (!added.contains(variableName) && lv.getQualifier() != 'o') {
added.add(variableName);
- b.append(" ");
+ b.append(" volatile ");
switch (lv.getQualifier()) {
case 'i' :
b.append("JAVA_INT"); break;

0 comments on commit 593b677

Please sign in to comment.