فهرست منبع

* disable several complex procedures for avr with a newly introduced define: EXCLUDE_COMPLEX_PROCS. They
might compile with an improved register allocator in the future

git-svn-id: trunk@30546 -

florian 10 سال پیش
والد
کامیت
886e3e8d02
5فایلهای تغییر یافته به همراه32 افزوده شده و 3 حذف شده
  1. 7 0
      rtl/embedded/system.pp
  2. 4 0
      rtl/inc/int64.inc
  3. 9 3
      rtl/inc/sstrings.inc
  4. 8 0
      rtl/inc/text.inc
  5. 4 0
      rtl/inc/typefile.inc

+ 7 - 0
rtl/embedded/system.pp

@@ -22,6 +22,13 @@ Unit System;
 
 
 {$define FPC_IS_SYSTEM}
 {$define FPC_IS_SYSTEM}
 {$define HAS_CMDLINE}
 {$define HAS_CMDLINE}
+
+{ currently, the avr compiler cannot compile complex procedures especially dealing with int64
+  which are probaly anyways rarely used on avr }
+{$ifdef CPUAVR}
+{$define EXCLUDE_COMPLEX_PROCS}
+{$endif CPUAVR}
+
 { $define USE_NOTHREADMANAGER}
 { $define USE_NOTHREADMANAGER}
 
 
 {$define DISABLE_NO_THREAD_MANAGER}
 {$define DISABLE_NO_THREAD_MANAGER}

+ 4 - 0
rtl/inc/int64.inc

@@ -323,6 +323,9 @@
          q1,q2,q3 : qword;
          q1,q2,q3 : qword;
 
 
       begin
       begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+         runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
         { there's no difference between signed and unsigned multiplication,
         { there's no difference between signed and unsigned multiplication,
           when the destination size is equal to the source size and overflow
           when the destination size is equal to the source size and overflow
           checking is off }
           checking is off }
@@ -363,6 +366,7 @@
             else
             else
               fpc_mul_int64:=q3;
               fpc_mul_int64:=q3;
           end;
           end;
+{$endif EXCLUDE_COMPLEX_PROCS}
       end;
       end;
 {$endif FPC_SYSTEM_HAS_MUL_INT64}
 {$endif FPC_SYSTEM_HAS_MUL_INT64}
 
 

+ 9 - 3
rtl/inc/sstrings.inc

@@ -990,24 +990,26 @@ end;
 {$endif}
 {$endif}
 
 
 {$ifndef FPC_STR_ENUM_INTERN}
 {$ifndef FPC_STR_ENUM_INTERN}
-{ currently, the avr code generator fails on this procedure, so we disable it, 
+{ currently, the avr code generator fails on this procedure, so we disable it,
   this is not a good solution but fixing compilation of this procedure for
   this is not a good solution but fixing compilation of this procedure for
   avr is hard, requires significant changes to the register allocator to take
   avr is hard, requires significant changes to the register allocator to take
   care of different register classes }
   care of different register classes }
-{$ifndef CPUAVR}
 procedure fpc_chararray_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out a : array of char);compilerproc;
 procedure fpc_chararray_enum(ordinal,len:sizeint;typinfo,ord2strindex:pointer;out a : array of char);compilerproc;
 var
 var
   ss : shortstring;
   ss : shortstring;
   maxlen : SizeInt;
   maxlen : SizeInt;
 begin
 begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+  runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
   fpc_shortstr_enum(ordinal,len,typinfo,ord2strindex,ss);
   fpc_shortstr_enum(ordinal,len,typinfo,ord2strindex,ss);
   if length(ss)<high(a)+1 then
   if length(ss)<high(a)+1 then
     maxlen:=length(ss)
     maxlen:=length(ss)
   else
   else
     maxlen:=high(a)+1;
     maxlen:=high(a)+1;
   fpc_shortstr_chararray_intern_charmove(ss,a,maxlen);
   fpc_shortstr_chararray_intern_charmove(ss,a,maxlen);
+{$endif EXCLUDE_COMPLEX_PROCS}
 end;
 end;
-{$endif CPUAVR}
 {$endif not FPC_STR_ENUM_INTERN}
 {$endif not FPC_STR_ENUM_INTERN}
 
 
 procedure fpc_chararray_bool(b : boolean;len:sizeint;out a : array of char);compilerproc;
 procedure fpc_chararray_bool(b : boolean;len:sizeint;out a : array of char);compilerproc;
@@ -1220,6 +1222,9 @@ end;
         maxqword=qword($ffffffffffffffff);
         maxqword=qword($ffffffffffffffff);
 
 
   begin
   begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+    runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
     fpc_val_int64_shortstr := 0;
     fpc_val_int64_shortstr := 0;
     Temp:=0;
     Temp:=0;
     Code:=InitVal(s,negative,base);
     Code:=InitVal(s,negative,base);
@@ -1263,6 +1268,7 @@ end;
     fpc_val_int64_shortstr:=int64(Temp);
     fpc_val_int64_shortstr:=int64(Temp);
     If Negative Then
     If Negative Then
       fpc_val_int64_shortstr:=-fpc_val_int64_shortstr;
       fpc_val_int64_shortstr:=-fpc_val_int64_shortstr;
+{$endif EXCLUDE_COMPLEX_PROCS}
   end;
   end;
 
 
 
 

+ 8 - 0
rtl/inc/text.inc

@@ -1217,6 +1217,9 @@ var
     s:string;
     s:string;
 
 
 begin
 begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+  runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
   if textrec(t).mode<>fmoutput then
   if textrec(t).mode<>fmoutput then
     begin
     begin
       if textrec(t).mode=fminput then
       if textrec(t).mode=fminput then
@@ -1229,6 +1232,7 @@ begin
   if (inoutres <> 0) then
   if (inoutres <> 0) then
     exit;
     exit;
   fpc_writeBuffer(t,s[1],length(s));
   fpc_writeBuffer(t,s[1],length(s));
+{$endif EXCLUDE_COMPLEX_PROCS}
 end;
 end;
 
 
 {$ifdef FPC_HAS_STR_CURRENCY}
 {$ifdef FPC_HAS_STR_CURRENCY}
@@ -1681,6 +1685,9 @@ var
   p,startp,maxp : pchar;
   p,startp,maxp : pchar;
   end_of_string:boolean;
   end_of_string:boolean;
 Begin
 Begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+  runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
   ReadPCharLen:=0;
   ReadPCharLen:=0;
   If not CheckRead(f) then
   If not CheckRead(f) then
     exit;
     exit;
@@ -1722,6 +1729,7 @@ Begin
     inc(sPos,Len);
     inc(sPos,Len);
   until (spos=MaxLen) or end_of_string;
   until (spos=MaxLen) or end_of_string;
   ReadPCharLen:=spos;
   ReadPCharLen:=spos;
+{$endif EXCLUDE_COMPLEX_PROCS}
 End;
 End;
 
 
 
 

+ 4 - 0
rtl/inc/typefile.inc

@@ -81,8 +81,12 @@ Procedure DoAssign(var t : TypedFile);
 const
 const
   start : dword = 0;
   start : dword = 0;
 Begin
 Begin
+{$ifdef EXCLUDE_COMPLEX_PROCS}
+  runerror(219);
+{$else EXCLUDE_COMPLEX_PROCS}
   Assign(t,'fpc_'+HexStr(start,8)+'.tmp');
   Assign(t,'fpc_'+HexStr(start,8)+'.tmp');
   inc(start);
   inc(start);
+{$endif EXCLUDE_COMPLEX_PROCS}
 End;
 End;
 {$endif FPC_HAS_FEATURE_RANDOM}
 {$endif FPC_HAS_FEATURE_RANDOM}