Skip to content

[simplifycfg] constantexpr divide evaluation made unconditional #1329

Closed
@llvmbot

Description

@llvmbot
Bugzilla Link 957
Resolution FIXED
Resolved on Mar 06, 2010 14:07
Version trunk
OS All
Attachments Test case
Reporter LLVM Bugzilla Contributor
CC @lattner

Extended Description

Without predsimplify pass:

LBB1_18: #cond_false179
testl %ebp, %ebp
jne LBB1_20 #cond_next185
LBB1_19: #cond_true182
movl $1, %eax
xorl %edx, %edx
divl %ebp
movl %eax, %ebp
LBB1_20: #cond_next185
cmpl $65535, %ebp
ja LBB1_24 #cond_false199

The divl is properly guarded to prevent divide by zero.

With -predsimplify:

LBB1_25: #cond_true182
xorl %edx, %edx
movl $1, %eax
divl %edx
movl %eax, %ebp
LBB1_26: #cond_next185
cmpl $65535, %ebp
ja LBB1_30 #cond_false199

That's guaranteed to cause an divide by zero exception!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions