Prechádzať zdrojové kódy

* fixed llvm a_load_reg_ref() when storing a register to a record reference
of 3/5/6/7 bytes

git-svn-id: trunk@32292 -

Jonas Maebe 9 rokov pred
rodič
commit
3e917f5889
1 zmenil súbory, kde vykonal 5 pridanie a 1 odobranie
  1. 5 1
      compiler/llvm/hlcgllvm.pas

+ 5 - 1
compiler/llvm/hlcgllvm.pas

@@ -532,8 +532,12 @@ implementation
                 truncate it before storing. Unfortunately, we cannot truncate
                 truncate it before storing. Unfortunately, we cannot truncate
                 records (nor bitcast them to integers), so we first have to
                 records (nor bitcast them to integers), so we first have to
                 store them to memory and then bitcast the pointer to them
                 store them to memory and then bitcast the pointer to them
+
+                We can't truncate an integer to 3/5/6/7 bytes either, so also
+                pass via a temp in that case
               }
               }
-              if fromsize.typ in [arraydef,recorddef] then
+              if (fromsize.typ in [arraydef,recorddef]) or
+                 (tosize.size in [3,5,6,7]) then
                 begin
                 begin
                   { store struct/array-in-register to memory }
                   { store struct/array-in-register to memory }
                   tg.gethltemp(list,fromsize,fromsize.size,tt_normal,tmpref);
                   tg.gethltemp(list,fromsize,fromsize.size,tt_normal,tmpref);