Переглянути джерело

* truncate indices into arrays from 64 to 32 bit on 32 bit
platforms so that their code generators don't get 64 bit
operands (fixes internalerrors on at least ppc32 after r20108)

git-svn-id: trunk@20132 -

Jonas Maebe 13 роки тому
батько
коміт
ab9b52a003
1 змінених файлів з 10 додано та 1 видалено
  1. 10 1
      compiler/nmem.pas

+ 10 - 1
compiler/nmem.pas

@@ -849,7 +849,16 @@ implementation
                      (tarraydef(left.resultdef).highrange<>torddef(htype).high)) then
                      (tarraydef(left.resultdef).highrange<>torddef(htype).high)) then
                     {Convert array indexes to low_bound..high_bound.}
                     {Convert array indexes to low_bound..high_bound.}
                    begin
                    begin
-                     if right.resultdef.typ=orddef then
+                     if (right.resultdef.typ=orddef)
+{$ifndef cpu64bitaddr}
+                        { do truncate 64 bit values on 32 bit cpus, since
+                           a) the arrays cannot be > 32 bit anyway
+                           b) their code generators can't directly handle 64 bit
+                              loads
+                        }
+                        and not is_64bit(right.resultdef)
+{$endif not cpu64bitaddr}
+                        then
                        newordtyp:=Torddef(right.resultdef).ordtype
                        newordtyp:=Torddef(right.resultdef).ordtype
                      else
                      else
                        newordtyp:=torddef(ptrsinttype).ordtype;
                        newordtyp:=torddef(ptrsinttype).ordtype;