1.4K Star 7.6K Fork 1.4K

GVP方舟编译器 / OpenArkCompiler

 / 详情

valueRangePropagation deletes comparison of unsigned int against signed maxint

已完成
成员
创建于  
2021-09-06 06:26

Test case in .mpl (from 20020510-1.c):

void
testl (unsigned long l, int ok)
{
if ((l>=1) && (l<=LONG_MAX))
{
if (!ok) abort ();
}
else
if (ok) abort ();
}

The valueRangePropagation phase deletes (l<=LONG_MAX).

评论 (2)

fredchow 创建了任务
fredchow 负责人设置为刘岩
展开全部操作日志

Bug only shows up with this form of maple IR:

func &testl (var %l u64, var %ok i32) void {
  funcid 5

LOC 2 47
LOC 2 48
  if (cand i32 (
    ge i32 u64 (dread u64 %l, constval u64 1),
    le i32 u64 (dread u64 %l, constval u64 0x7fffffffffffffff))) {
LOC 2 50
    if (eq i32 i32 (dread i32 %ok, constval i32 0)) {
      call &abort ()
    }
  }
  else {
LOC 2 53
    if (ne i32 i32 (dread i32 %ok, constval i32 0)) {
      call &abort ()
    }
  }
LOC 2 54
  return ()
}

Fix is in master branch.

fredchow 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(1)
C++
1
https://gitee.com/openarkcompiler/OpenArkCompiler.git
git@gitee.com:openarkcompiler/OpenArkCompiler.git
openarkcompiler
OpenArkCompiler
OpenArkCompiler

搜索帮助

53164aa7 5694891 3bd8fe86 5694891