From f9a56afa151b5481511f2f1f1983613d3e9034aa Mon Sep 17 00:00:00 2001 From: "Jake.Stine" Date: Wed, 7 Jul 2010 20:01:30 +0000 Subject: [PATCH] Re-fix for some GCC packed structure bug. Hopefully this version works. It should according to the bug being tracked. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3421 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/VUmicroMem.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pcsx2/VUmicroMem.cpp b/pcsx2/VUmicroMem.cpp index 923810be13..b61a024b33 100644 --- a/pcsx2/VUmicroMem.cpp +++ b/pcsx2/VUmicroMem.cpp @@ -111,13 +111,14 @@ void SaveStateBase::vuMicroFreeze() pxAssume( VU1.Mem != NULL ); Freeze(VU0.ACC); -#ifdef __LINUX__ - // GCC is unable to bind packed fields. - u32 temp_vu0_code = VU0.code; + + // Seemingly silly and pointless use of temp var: GCC is unable to bind packed fields + // (appears to be a bug, tracked here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36566 ). + // Dereferencing outside the context of the function (via a temp var) seems to circumvent it. --air + + u32& temp_vu0_code = VU0.code; Freeze(temp_vu0_code); -#else - Freeze(VU0.code); -#endif + FreezeMem(VU0.Mem, 4*1024); FreezeMem(VU0.Micro, 4*1024); @@ -125,13 +126,10 @@ void SaveStateBase::vuMicroFreeze() Freeze(VU0.VI); Freeze(VU1.ACC); -#ifdef __LINUX__ - // GCC is unable to bind packed fields. - u32 temp_vu1_code = VU1.code; + + u32& temp_vu1_code = VU1.code; Freeze(temp_vu1_code); -#else - Freeze(VU1.code); -#endif + FreezeMem(VU1.Mem, 16*1024); FreezeMem(VU1.Micro, 16*1024);