Avoid modifying the OneClassForEachPhysReg map while iterating over it.
authorBob Wilson <bob.wilson@apple.com>
Thu, 27 Jan 2011 07:26:15 +0000 (07:26 +0000)
committerBob Wilson <bob.wilson@apple.com>
Thu, 27 Jan 2011 07:26:15 +0000 (07:26 +0000)
commitadf9c8b0e7e7365a172e3c452dfe108f31d9a387
treead167371e73ffca0af9a3a26eec04ca1cb0ba499
parentf382f3b4dd047a8e60371c6642d1d5a2358d3eb1
Avoid modifying the OneClassForEachPhysReg map while iterating over it.
Linear scan regalloc is currently assuming that any register aliased with
a member of a regclass must also be in at least one regclass.  That is not
always true.  For example, for X86, RIP is in a regclass but IP is not.
If you're unlucky, this can cause a crash by invalidating the iterator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124365 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegAllocLinearScan.cpp