소스 검색

* record the alignment of temps, and set it when creating a reference based
on a temp instead of assuming it's always aligned to a multiple of
the stackpointer size

git-svn-id: branches/hlcgllvm@28490 -

Jonas Maebe 11 년 전
부모
커밋
0fbaa9e924
3개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      compiler/hlcgobj.pas
  2. 1 0
      compiler/llvm/tgllvm.pas
  3. 3 0
      compiler/tgobj.pas

+ 1 - 1
compiler/hlcgobj.pas

@@ -812,7 +812,7 @@ implementation
 
   procedure thlcgobj.temp_to_ref(p: ptemprecord; out ref: treference);
     begin
-      reference_reset_base(ref,voidstackpointertype,current_procinfo.framepointer,p^.pos,voidstackpointertype.size);
+      reference_reset_base(ref,voidstackpointertype,current_procinfo.framepointer,p^.pos,p^.alignment);
     end;
 
   procedure thlcgobj.a_label(list: TAsmList; l: tasmlabel); inline;

+ 1 - 0
compiler/llvm/tgllvm.pas

@@ -93,6 +93,7 @@ implementation
         tl^.temptype:=temptype;
         tl^.def:=def;
         tl^.fini:=fini;
+        tl^.alignment:=alignment;
         tl^.pos:=getsupreg(ref.base);
         tl^.size:=size;
         tl^.next:=templist;

+ 3 - 0
compiler/tgobj.pas

@@ -44,6 +44,7 @@ unit tgobj;
          temptype   : ttemptype;
          { finalize this temp if it's a managed type }
          fini       : boolean;
+         alignment  : shortint;
          pos        : asizeint;
          size       : asizeint;
          def        : tdef;
@@ -393,6 +394,7 @@ implementation
                { Create new block and resize the old block }
                tl^.fini:=fini;
                tl^.size:=size;
+               tl^.alignment:=alignment;
                tl^.nextfree:=nil;
                { Resize the old block }
                dec(bestslot^.size,size);
@@ -421,6 +423,7 @@ implementation
               end;
 
             tl^.fini:=fini;
+            tl^.alignment:=alignment;
             tl^.size:=size;
             tl^.next:=templist;
             tl^.nextfree:=nil;