39 Star 60 Fork 411

OpenHarmony / arkcompiler_runtime_core

 / 详情

[Bug]: [Compiler] Incorrect test result with --opt-level=2 after bytecode_optimizer

已拒绝
创建于  
2024-03-14 16:54

发生了什么问题?

[ArkTS frontend] Incorrect test result with --opt-level=2

Test case produces different results for opt level 0 and 2:

let a = 12
let b = 11
let res = ""

function foo(): string {
    res += "foo called"
    return "Assert message"
}

function main(): int {
    res = ""
    try {
        assert (a > b ? b == a : a < b) : foo()  // foo must be called
    } catch (e) {
        // expected
    }
    return res == "" ?  1 : 0
}

output with --opt-level=0, correct result, exit code = 0:

bin/es2panda --arktsconfig=tools/es2panda/generated/arktsconfig.json --log-level=error --thread=0 --opt-level=0 --extension=ets --gen-stdlib=false --output=/tmp/assert_8.abc /home/vkopyl/ohos_root/arkcompiler/runtime_core/static_core/plugins/ets/tests/output/gen/17.experimental_features/05.statements/03.assert_statement/assert_8.ets 2>&1 

bin/verifier --boot-panda-files=plugins/ets/etsstdlib.abc --load-runtimes=ets --config-file=/home/vkopyl/ohos_root/arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner/plugins/ets/ets-verifier.config /tmp/assert_8.abc 2>&1 

bin/ark --boot-panda-files=plugins/ets/etsstdlib.abc --interpreter-type=cpp --load-runtimes=ets --compiler-enable-jit=true --compiler-check-final=true --gc-type=g1-gc --heap-verifier=fail_on_verification:pre:into:before_g1_concurrent:post --full-gc-bombing-frequency=0  /tmp/assert_8.abc ETSGLOBAL::main; echo __$?__ 

Assert message
__0__ 

output with --opt-level=2, incorrect result, exit code = 1:

bin/es2panda --arktsconfig=tools/es2panda/generated/arktsconfig.json --log-level=error --thread=0 --opt-level=2 --extension=ets --gen-stdlib=false --output=/tmp/assert_8.abc /home/vkopyl/ohos_root/arkcompiler/runtime_core/static_core/plugins/ets/tests/output/gen/17.experimental_features/05.statements/03.assert_statement/assert_8.ets 2>&1 

bin/verifier --boot-panda-files=plugins/ets/etsstdlib.abc --load-runtimes=ets --config-file=/home/vkopyl/ohos_root/arkcompiler/runtime_core/static_core/tests/tests-u-runner/runner/plugins/ets/ets-verifier.config /tmp/assert_8.abc 2>&1 

bin/ark --boot-panda-files=plugins/ets/etsstdlib.abc --interpreter-type=cpp --load-runtimes=ets --compiler-enable-jit=true --compiler-check-final=true --gc-type=g1-gc --heap-verifier=fail_on_verification:pre:into:before_g1_concurrent:post --full-gc-bombing-frequency=0  /tmp/assert_8.abc ETSGLOBAL::main; echo __$?__ 

Assert message
__1__

期望行为是什么?

The correct result is $?==0 It should be produced for both opt_level=0 and opt_level=2

如何复现该缺陷

see above

其他补充信息

版本或分支信息

  • master
  • Release 4.1
  • Release 4.0
  • Release 3.2

评论 (2)

sergign60 创建了任务
sergign60 添加了
 
bug
标签
展开全部操作日志

感谢提交Issue!关于Issue的交互操作,请访问OpenHarmony社区支持命令清单。如果有问题,请联系 @godmiaozi @peijiajun @Ishin Pavel @Vyacheslav Cherkashin 。如果需要调整订阅PR、Issue的变更状态,请访问链接

Thanks for submitting the issue. For more commands, please visit OpenHarmony Command List. If you have any questions, please refer to committer @godmiaozi @peijiajun @Ishin Pavel @Vyacheslav Cherkashin for help. If you need to change the subscription of a Pull Request or Issue, please visit the link.

openharmony_ci 添加了
 
waiting_for_assign
标签
Dmitrii Trubenkov 任务状态Backlog 修改为Declined

Closed because of the OHOS release

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
7387629 openharmony ci 1656582662 10435202 dmitriitr 1657126484
1
https://gitee.com/openharmony/arkcompiler_runtime_core.git
git@gitee.com:openharmony/arkcompiler_runtime_core.git
openharmony
arkcompiler_runtime_core
arkcompiler_runtime_core

搜索帮助

344bd9b3 5694891 D2dac590 5694891