Skip to content

use of uninitialized variables in SimpleRegisterCoalescing.cpp #2598

@sunfishcode

Description

@sunfishcode
Bugzilla Link 2226
Resolution FIXED
Resolved on Apr 16, 2008 15:12
Version trunk
OS All
Attachments this patch makes the problem more visible

Extended Description

SimpleRegisterCoalescing.cpp at line 1937 calls TargetInstrInfo::isMoveInstr
to get the source and destination registers of a move without checking
the result value to see if the instruction was actually a move. It looks like
it should be, but currently there are cases where this assumption doesn't
hold. When it doesn't the following code ends up referencing the
variables uninitialized.

For example, when compiling
test/CodeGen/Generic/2003-07-08-BadCastToBool.ll
on x86 the code at line 1073 inserts a non-move instruction into
JoinedCopies.

The attached patch demonstrates the problem by using an assert.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions