diff --git a/compiler/i8086/tgcpu.pas b/compiler/i8086/tgcpu.pas
index 862f8f684f..d4e97ad510 100644
--- a/compiler/i8086/tgcpu.pas
+++ b/compiler/i8086/tgcpu.pas
@@ -37,7 +37,7 @@ unit tgcpu;
 
       ttgi8086 = class(ttgobj)
       protected
-        procedure alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);override;
+        procedure alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);override;
       end;
 
 implementation
@@ -47,7 +47,7 @@ uses
 
 { ttgi8086 }
 
-procedure ttgi8086.alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
+procedure ttgi8086.alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
   begin
     inherited;
     ref.segment:=NR_SS;
diff --git a/compiler/jvm/tgcpu.pas b/compiler/jvm/tgcpu.pas
index 330428db2f..a3df27d3ce 100644
--- a/compiler/jvm/tgcpu.pas
+++ b/compiler/jvm/tgcpu.pas
@@ -42,7 +42,7 @@ unit tgcpu;
         protected
          procedure getimplicitobjtemp(list: TAsmList; def: tdef; temptype: ttemptype; out ref: treference);
          function getifspecialtemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference): boolean;
-         procedure alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); override;
+         procedure alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); override;
         public
          procedure setfirsttemp(l : asizeint); override;
          procedure getlocal(list: TAsmList; size: asizeint; alignment: shortint; def: tdef; var ref: treference); override;
@@ -215,7 +215,7 @@ unit tgcpu;
       end;
 
 
-    procedure ttgjvm.alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
+    procedure ttgjvm.alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
       begin
         { the JVM only supports 1 slot (= 4 bytes in FPC) and 2 slot (= 8 bytes in
           FPC) temps on the stack. double and int64 are 2 slots, the rest is one slot.
diff --git a/compiler/llvm/tgllvm.pas b/compiler/llvm/tgllvm.pas
index 17f4f80867..994ced7d46 100644
--- a/compiler/llvm/tgllvm.pas
+++ b/compiler/llvm/tgllvm.pas
@@ -55,7 +55,7 @@ unit tgllvm;
 
       ttgllvm = class(ttgobj)
        protected
-        procedure alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); override;
+        procedure alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); override;
        public
         alloclist: tasmlist;
 
@@ -82,7 +82,7 @@ implementation
 
     { ttgllvm }
 
-    procedure ttgllvm.alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
+    procedure ttgllvm.alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference);
       var
         tl: ptemprecord;
         oldfileinfo: tfileposinfo;
diff --git a/compiler/tgobj.pas b/compiler/tgobj.pas
index d1a97f6414..beb1001b62 100644
--- a/compiler/tgobj.pas
+++ b/compiler/tgobj.pas
@@ -61,9 +61,9 @@ unit tgobj;
        protected
           { contains all free temps using nextfree links }
           tempfreelist  : ptemprecord;
-          procedure alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); virtual;
+          procedure alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref: treference); virtual;
           procedure freetemp(list: TAsmList; pos: asizeint; temptypes: ttemptypeset);virtual;
-          procedure gettempinternal(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref : treference);
+          procedure gettempinternal(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref : treference);
        public
           { contains all temps }
           templist      : ptemprecord;
@@ -86,7 +86,7 @@ unit tgobj;
              @param(l start offset where temps will start in stack)
           }
           procedure setfirsttemp(l: asizeint); virtual;
-          procedure setalignmentmismatch(l : longint); virtual;
+          procedure setalignmentmismatch(l: shortint); virtual;
 
           { version of gettemp that is compatible with hlcg-based targets;
             always use in common code, only use gettemp in cgobj and
@@ -96,7 +96,7 @@ unit tgobj;
             don't have an inherent size (e.g., array of const) }
           procedure gethltemp(list: TAsmList; def: tdef; forcesize: asizeint; temptype: ttemptype; out ref: treference); virtual;
           procedure gethltempmanaged(list: TAsmList; def: tdef; temptype: ttemptype; out ref: treference); virtual;
-          procedure gettemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; out ref : treference);
+          procedure gettemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; out ref : treference);
           procedure gettempmanaged(list: TAsmList; def:tdef;temptype:ttemptype;out ref : treference);
           procedure ungettemp(list: TAsmList; const ref : treference);
 
@@ -232,13 +232,13 @@ implementation
       end;
 
 
-    procedure ttgobj.setalignmentmismatch(l: longint);
+    procedure ttgobj.setalignmentmismatch(l: shortint);
       begin
         alignmismatch:=l*direction;
       end;
 
 
-    procedure ttgobj.alloctemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def :tdef; fini: boolean; out ref: treference);
+    procedure ttgobj.alloctemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def :tdef; fini: boolean; out ref: treference);
       var
          tl,htl,
          bestslot,bestprev,
@@ -540,13 +540,13 @@ implementation
 
 
 
-    procedure ttgobj.gettemp(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; out ref : treference);
+    procedure ttgobj.gettemp(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; out ref : treference);
       begin
         gettempinternal(list,size,alignment,temptype,nil,false,ref);
       end;
 
 
-    procedure ttgobj.gettempinternal(list: TAsmList; size: asizeint; alignment: longint; temptype: ttemptype; def: tdef; fini: boolean; out ref : treference);
+    procedure ttgobj.gettempinternal(list: TAsmList; size: asizeint; alignment: shortint; temptype: ttemptype; def: tdef; fini: boolean; out ref : treference);
       var
         varalign : shortint;
       begin