Browse Source

* disable sse/mmx fastmode code in case of valgrind usage

git-svn-id: trunk@5342 -
florian 19 years ago
parent
commit
90787bb436
2 changed files with 15 additions and 0 deletions
  1. 5 0
      compiler/pmodules.pas
  2. 10 0
      rtl/i386/fastmove.inc

+ 5 - 0
compiler/pmodules.pas

@@ -407,6 +407,11 @@ implementation
         new_section(current_asmdata.asmlists[al_globals],sec_data,'__heapsize',sizeof(aint));
         current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global('__heapsize',AT_DATA,sizeof(aint)));
         current_asmdata.asmlists[al_globals].concat(Tai_const.Create_aint(heapsize));
+        { Initial heapsize }
+        maybe_new_object_file(current_asmdata.asmlists[al_globals]);
+        new_section(current_asmdata.asmlists[al_globals],sec_data,'__fpc_valgrind',sizeof(boolean));
+        current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global('__fpc_valgrind',AT_DATA,sizeof(boolean)));
+        current_asmdata.asmlists[al_globals].concat(Tai_const.create_8bit(byte(cs_gdb_valgrind in current_settings.globalswitches)));
       end;
 
 

+ 10 - 0
rtl/i386/fastmove.inc

@@ -830,9 +830,19 @@ end;
 {$endif INTERNALMOVEFILLCHAR}
 
 {$asmmode att}
+{$ifdef FPC_HAS_VALGRINDBOOL}
+var
+  valgrind_used : boolean;external name '__fpc_valgrind';
+{$endif FPC_HAS_VALGRINDBOOL}
 
 procedure setup_fastmove;{$ifdef SYSTEMINLINE}inline;{$endif}
   begin
+{$ifdef FPC_HAS_VALGRINDBOOL}
+    { workaround valgrind bug }
+    if valgrind_used then
+      exit;
+{$endif FPC_HAS_VALGRINDBOOL}
+
     if has_sse_support then
       begin
         fastmoveproc_forward:=@Forwards_SSE_3;