]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Update comment in r2229 to place the blame in the right place.
authorJulian Seward <jseward@acm.org>
Mon, 31 Oct 2011 15:25:55 +0000 (15:25 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 31 Oct 2011 15:25:55 +0000 (15:25 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@2230

VEX/priv/guest_x86_helpers.c

index 5d8769e03cb1252c1512cbf18a369c31c127c487..d14d08b0fb125228f12e96340bf676d84cfd095c 100644 (file)
@@ -1788,13 +1788,14 @@ VexEmWarn x86g_dirtyhelper_FXRSTOR ( VexGuestX86State* gst, HWord addr )
    /* Copy the x87 registers out of the image, into a temporary
       Fpu_State struct. */
 
-   /* Defeat LLVM's memset-idiom recognition mechanism.  It
-      appears to turn this into a misaligned movaps, which faults.
-      This is with Xcode 4.1 (Build version 4B110), on x86-darwin,
-      i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 
-      (Based on Apple Inc. build 5658) (LLVM build 2335.15.00),
-      OSX 10.7.1.
-   */
+   /* LLVM on Darwin turns the following loop into a movaps plus a
+      handful of scalar stores.  This would work fine except for the
+      fact that VEX doesn't keep the stack correctly (16-) aligned for
+      the call, so it segfaults.  Hence, split the loop into two
+      pieces (and pray LLVM doesn't merely glue them back together) so
+      it's composed only of scalar stores and so is alignment
+      insensitive.  Of course this is a kludge of the lamest kind --
+      VEX should be fixed properly. */
    /* Code that seems to trigger the problem:
       for (i = 0; i < 14; i++) tmp.env[i] = 0; */
    for (i = 0; i < 7; i++) tmp.env[i+0] = 0;