Skip to content
Snippets Groups Projects
Commit 7347790c authored by Tobias S. Josefowitz's avatar Tobias S. Josefowitz
Browse files

Optimizer: Be more careful when optimizing away assignments

Checking for SCOPE_SCOPED is too agressive, check for SCOPE_SCOPE_USED
instead.
parent c17ffc68
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,10 @@ o Compiler
- Fixed some corner cases where file names where missing from
backtraces.
- Check the proper flag to determine if a local variable may be used
before optimizing away certain assignments if the assignment is
immediately followed by a return of the variable in question.
Crypto.ECC
Now works against Nettle 3.5.
......
......@@ -216,8 +216,8 @@ ASSIGN_GLOBAL_AND_POP GLOBAL_LVALUE($1a) DEC_AND_POP : ADD_NEG_INT(1) ASSIGN_GLO
GLOBAL_LVALUE INC_AND_POP GLOBAL($1a) : GLOBAL_LVALUE($1a) INC
GLOBAL_LVALUE DEC_AND_POP GLOBAL($1a) : GLOBAL_LVALUE($1a) DEC
ASSIGN_LOCAL RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: RETURN
ASSIGN_LOCAL VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPED)]: VOLATILE_RETURN
ASSIGN_LOCAL RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPE_USED)]: RETURN
ASSIGN_LOCAL VOLATILE_RETURN [!(Pike_compiler->compiler_frame->lexical_scope & SCOPE_SCOPE_USED)]: VOLATILE_RETURN
ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a)
ASSIGN_LOCAL BRANCH_WHEN_ZERO LOCAL($1a) VOLATILE_RETURN LABEL($2a): ASSIGN_LOCAL($1a) RETURN_IF_TRUE LABEL($2a)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment