On X86, MEMBARRIER, MFENCE, SFENCE, LFENCE are not target memory intrinsics,
authorDuncan Sands <baldrick@free.fr>
Sat, 20 Nov 2010 11:25:00 +0000 (11:25 +0000)
committerDuncan Sands <baldrick@free.fr>
Sat, 20 Nov 2010 11:25:00 +0000 (11:25 +0000)
commit59d2dad59ebba1d82e5b72f78b7a5b2c873445d7
treeccebb41eaf760e4dc3e2092947ba9a7e8e0bfcc1
parentb9e6fe1e3afe3c4cdbdddfb563adc10c439dc296
On X86, MEMBARRIER, MFENCE, SFENCE, LFENCE are not target memory intrinsics,
so don't claim they are.  They are allocated using DAG.getNode, so attempts
to access MemSDNode fields results in reading off the end of the allocated
memory.  This fixes crashes with "llc -debug" due to debug code trying to
print MemSDNode fields for these barrier nodes (since the crashes are not
deterministic, use valgrind to see this).  Add some nasty checking to try
to catch this kind of thing in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119901 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/SelectionDAG.h
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/Target/X86/X86ISelLowering.h