Branch: Tag:

2019-11-02

2019-11-02 17:43:57 by Tobias S. Josefowitz <tobij@tobij.de>

Optimizer: Be more careful when optimizing away assignments

Checking for SCOPE_SCOPED is too agressive, SCOPE_SCOPE_USED would work,
but we now look at the variable directly.

228:   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->variable[$1a].flags & LOCAL_VAR_USED_IN_SCOPE)]: RETURN + ASSIGN_LOCAL VOLATILE_RETURN [!(Pike_compiler->compiler_frame->variable[$1a].flags & LOCAL_VAR_USED_IN_SCOPE)]: 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)