Fix a crash in block placement due to an inner loop that happened to be
authorChandler Carruth <chandlerc@gmail.com>
Wed, 23 Nov 2011 03:03:21 +0000 (03:03 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Wed, 23 Nov 2011 03:03:21 +0000 (03:03 +0000)
commit47fb954f7437250eda152ed4165af5ac1c0ec366
tree7ca67a3ead5103cb27fd80f65f9e1abb92bf22a0
parentd2703dec271d82c8c9d22afb835c07730fd25d47
Fix a crash in block placement due to an inner loop that happened to be
reversed in the function's original ordering, and we happened to
encounter it while handling an outer unnatural CFG structure.

Thanks to the test case reduced from GCC's source by Benjamin Kramer.
This may also fix a crasher in gzip that Duncan reduced for me, but
I haven't yet gotten to testing that one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145094 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/MachineBlockPlacement.cpp
test/CodeGen/X86/block-placement.ll