mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-26 16:33:45 +01:00 
			
		
		
		
	* fixed ppc compilation
git-svn-id: trunk@2778 -
This commit is contained in:
		
							parent
							
								
									d772104ce7
								
							
						
					
					
						commit
						ab5f5ca15e
					
				| @ -592,6 +592,9 @@ interface | |||||||
| 
 | 
 | ||||||
|            function  Pass1(objdata:TObjData):longint;virtual;abstract; |            function  Pass1(objdata:TObjData):longint;virtual;abstract; | ||||||
|            procedure Pass2(objdata:TObjData);virtual;abstract; |            procedure Pass2(objdata:TObjData);virtual;abstract; | ||||||
|  | 
 | ||||||
|  |            procedure resetpass1; virtual; | ||||||
|  |            procedure resetpass2; virtual; | ||||||
|         end; |         end; | ||||||
|         tai_cpu_class = class of tai_cpu_abstract; |         tai_cpu_class = class of tai_cpu_abstract; | ||||||
| 
 | 
 | ||||||
| @ -2365,6 +2368,16 @@ implementation | |||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |     procedure tai_cpu_abstract.resetpass1; | ||||||
|  |       begin | ||||||
|  |       end; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |     procedure tai_cpu_abstract.resetpass2; | ||||||
|  |       begin | ||||||
|  |       end; | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| {**************************************************************************** | {**************************************************************************** | ||||||
|                               tai_align_abstract |                               tai_align_abstract | ||||||
|  ****************************************************************************} |  ****************************************************************************} | ||||||
|  | |||||||
| @ -86,13 +86,13 @@ Unit aopt; | |||||||
|                    (tai_Marker(P).Kind <> AsmBlockStart)) Do |                    (tai_Marker(P).Kind <> AsmBlockStart)) Do | ||||||
|               Begin |               Begin | ||||||
|                 If (p.typ = ait_label) Then |                 If (p.typ = ait_label) Then | ||||||
|                   If (tai_Label(p).l.is_used) Then |                   If (tai_Label(p).labsym.is_used) Then | ||||||
|                     Begin |                     Begin | ||||||
|                       LabelFound := True; |                       LabelFound := True; | ||||||
|                       If (tai_Label(p).l.labelnr < LowLabel) Then |                       If (tai_Label(p).labsym.labelnr < LowLabel) Then | ||||||
|                         LowLabel := tai_Label(p).l.labelnr; |                         LowLabel := tai_Label(p).labsym.labelnr; | ||||||
|                       If (tai_Label(p).l.labelnr > HighLabel) Then |                       If (tai_Label(p).labsym.labelnr > HighLabel) Then | ||||||
|                         HighLabel := tai_Label(p).l.labelnr |                         HighLabel := tai_Label(p).labsym.labelnr | ||||||
|                     End; |                     End; | ||||||
|                 prev := p; |                 prev := p; | ||||||
|                 GetNextInstruction(p, p) |                 GetNextInstruction(p, p) | ||||||
| @ -124,8 +124,8 @@ Unit aopt; | |||||||
|               Begin |               Begin | ||||||
|                 Case p.typ Of |                 Case p.typ Of | ||||||
|                   ait_Label: |                   ait_Label: | ||||||
|                     If tai_label(p).l.is_used Then |                     If tai_label(p).labsym.is_used Then | ||||||
|                       LabelTable^[tai_label(p).l.labelnr-LowLabel].PaiObj := p; |                       LabelTable^[tai_label(p).labsym.labelnr-LowLabel].PaiObj := p; | ||||||
|                   ait_regAlloc: |                   ait_regAlloc: | ||||||
|                     begin |                     begin | ||||||
|                     {!!!!!!!!! |                     {!!!!!!!!! | ||||||
|  | |||||||
| @ -153,7 +153,7 @@ unit aoptbase; | |||||||
|              ) or |              ) or | ||||||
| {$endif SPARC} | {$endif SPARC} | ||||||
|              ((Current.typ = ait_label) And |              ((Current.typ = ait_label) And | ||||||
|               Not(Tai_Label(Current).l.is_used))) Do |               Not(Tai_Label(Current).labsym.is_used))) Do | ||||||
|         Current := tai(Current.Next); |         Current := tai(Current.Next); | ||||||
|       If Assigned(Current) And |       If Assigned(Current) And | ||||||
|          (Current.typ = ait_Marker) And |          (Current.typ = ait_Marker) And | ||||||
| @ -171,7 +171,7 @@ unit aoptbase; | |||||||
|     If Assigned(Current) And |     If Assigned(Current) And | ||||||
|        Not((Current.typ In SkipInstr) or |        Not((Current.typ In SkipInstr) or | ||||||
|            ((Current.typ = ait_label) And |            ((Current.typ = ait_label) And | ||||||
|             Not(Tai_Label(Current).l.is_used))) |             Not(Tai_Label(Current).labsym.is_used))) | ||||||
|       Then GetNextInstruction := True |       Then GetNextInstruction := True | ||||||
|       Else |       Else | ||||||
|         Begin |         Begin | ||||||
| @ -189,7 +189,7 @@ unit aoptbase; | |||||||
|               Not(Tai_Marker(Current).Kind in [AsmBlockEnd,NoPropInfoEnd])) or |               Not(Tai_Marker(Current).Kind in [AsmBlockEnd,NoPropInfoEnd])) or | ||||||
|              (Current.typ In SkipInstr) or |              (Current.typ In SkipInstr) or | ||||||
|              ((Current.typ = ait_label) And |              ((Current.typ = ait_label) And | ||||||
|                Not(Tai_Label(Current).l.is_used))) Do |                Not(Tai_Label(Current).labsym.is_used))) Do | ||||||
|         Current := Tai(Current.previous); |         Current := Tai(Current.previous); | ||||||
|       If Assigned(Current) And |       If Assigned(Current) And | ||||||
|          (Current.typ = ait_Marker) And |          (Current.typ = ait_Marker) And | ||||||
| @ -206,7 +206,7 @@ unit aoptbase; | |||||||
|     If Not(Assigned(Current)) or |     If Not(Assigned(Current)) or | ||||||
|        (Current.typ In SkipInstr) or |        (Current.typ In SkipInstr) or | ||||||
|        ((Current.typ = ait_label) And |        ((Current.typ = ait_label) And | ||||||
|         Not(Tai_Label(Current).l.is_used)) or |         Not(Tai_Label(Current).labsym.is_used)) or | ||||||
|        ((Current.typ = ait_Marker) And |        ((Current.typ = ait_Marker) And | ||||||
|         (Tai_Marker(Current).Kind = AsmBlockEnd)) |         (Tai_Marker(Current).Kind = AsmBlockEnd)) | ||||||
|       Then |       Then | ||||||
|  | |||||||
| @ -333,7 +333,7 @@ Unit AoptObj; | |||||||
|           While Assigned(p) And |           While Assigned(p) And | ||||||
|                 ((p.typ in (SkipInstr - [ait_RegAlloc])) or |                 ((p.typ in (SkipInstr - [ait_RegAlloc])) or | ||||||
|                  ((p.typ = ait_label) And |                  ((p.typ = ait_label) And | ||||||
|                   Not(Tai_Label(p).l.is_used))) Do |                   Not(Tai_Label(p).labsym.is_used))) Do | ||||||
|                p := Tai(p.next); |                p := Tai(p.next); | ||||||
|           While Assigned(p) And |           While Assigned(p) And | ||||||
|                 (p.typ=ait_RegAlloc) Do |                 (p.typ=ait_RegAlloc) Do | ||||||
| @ -349,7 +349,7 @@ Unit AoptObj; | |||||||
|         Until Not(Assigned(p)) Or |         Until Not(Assigned(p)) Or | ||||||
|               (Not(p.typ in SkipInstr) And |               (Not(p.typ in SkipInstr) And | ||||||
|                Not((p.typ = ait_label) And |                Not((p.typ = ait_label) And | ||||||
|                   Not(Tai_Label(p).l.is_used))); |                   Not(Tai_Label(p).labsym.is_used))); | ||||||
|       End; |       End; | ||||||
| 
 | 
 | ||||||
|       Function TUsedRegs.IsUsed(Reg: TRegister): Boolean; |       Function TUsedRegs.IsUsed(Reg: TRegister): Boolean; | ||||||
| @ -742,7 +742,7 @@ Unit AoptObj; | |||||||
|         While Assigned(TempP) and |         While Assigned(TempP) and | ||||||
|              (TempP.typ In SkipInstr + [ait_label]) Do |              (TempP.typ In SkipInstr + [ait_label]) Do | ||||||
|           If (TempP.typ <> ait_Label) Or |           If (TempP.typ <> ait_Label) Or | ||||||
|              (Tai_label(TempP).l <> L) |              (Tai_label(TempP).labsym <> L) | ||||||
|             Then GetNextInstruction(TempP, TempP) |             Then GetNextInstruction(TempP, TempP) | ||||||
|             Else |             Else | ||||||
|               Begin |               Begin | ||||||
| @ -824,7 +824,7 @@ Unit AoptObj; | |||||||
|           While Assigned(StartPai) And |           While Assigned(StartPai) And | ||||||
|                 ((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or |                 ((StartPai.typ in (SkipInstr - [ait_regAlloc])) Or | ||||||
|                  ((StartPai.typ = ait_label) and |                  ((StartPai.typ = ait_label) and | ||||||
|                   Not(Tai_Label(StartPai).l.Is_Used))) Do |                   Not(Tai_Label(StartPai).labsym.Is_Used))) Do | ||||||
|             StartPai := Tai(StartPai.Next); |             StartPai := Tai(StartPai.Next); | ||||||
|           If Assigned(StartPai) And |           If Assigned(StartPai) And | ||||||
|              (StartPai.typ = ait_regAlloc) and (tai_regalloc(StartPai).ratype=ra_alloc) Then |              (StartPai.typ = ait_regAlloc) and (tai_regalloc(StartPai).ratype=ra_alloc) Then | ||||||
| @ -871,7 +871,7 @@ Unit AoptObj; | |||||||
|            (tai(hp.next).typ = ait_label) then |            (tai(hp.next).typ = ait_label) then | ||||||
|           begin |           begin | ||||||
|             FindAnyLabel := true; |             FindAnyLabel := true; | ||||||
|             l := tai_label(hp.next).l; |             l := tai_label(hp.next).labsym; | ||||||
|           end |           end | ||||||
|       end; |       end; | ||||||
| 
 | 
 | ||||||
| @ -1053,7 +1053,7 @@ Unit AoptObj; | |||||||
|                                   if taicpu(p).opcode=aopt_condjmp then |                                   if taicpu(p).opcode=aopt_condjmp then | ||||||
|                                     begin |                                     begin | ||||||
|                                       taicpu(p).condition:=inverse_cond(taicpu(p).condition); |                                       taicpu(p).condition:=inverse_cond(taicpu(p).condition); | ||||||
|                                       tai_label(hp2).l.decrefs; |                                       tai_label(hp2).labsym.decrefs; | ||||||
|                                       taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol; |                                       taicpu(p).oper[0]^.ref^.symbol:=taicpu(hp1).oper[0]^.ref^.symbol; | ||||||
|                                       { when freeing hp1, the reference count  |                                       { when freeing hp1, the reference count  | ||||||
|                                         isn't decreased, so don't increase |                                         isn't decreased, so don't increase | ||||||
|  | |||||||
| @ -451,9 +451,9 @@ uses cutils, cclasses; | |||||||
|           begin |           begin | ||||||
|             if p.typ = ait_label then |             if p.typ = ait_label then | ||||||
|               begin |               begin | ||||||
|                 if (tai_label(p).l.labelnr >= labelpositions.count) then |                 if (tai_label(p).labsym.labelnr >= labelpositions.count) then | ||||||
|                   labelpositions.count := tai_label(p).l.labelnr * 2; |                   labelpositions.count := tai_label(p).labsym.labelnr * 2; | ||||||
|                 labelpositions[tai_label(p).l.labelnr] := pointer(instrpos); |                 labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos); | ||||||
|               end; |               end; | ||||||
|             if p.typ = ait_instruction then |             if p.typ = ait_instruction then | ||||||
|               inc(instrpos); |               inc(instrpos); | ||||||
| @ -473,9 +473,9 @@ uses cutils, cclasses; | |||||||
|                   // of jumps |                   // of jumps | ||||||
|                   begin |                   begin | ||||||
|                     // can happen because of newly inserted labels |                     // can happen because of newly inserted labels | ||||||
|                     if (tai_label(p).l.labelnr > labelpositions.count) then |                     if (tai_label(p).labsym.labelnr > labelpositions.count) then | ||||||
|                       labelpositions.count := tai_label(p).l.labelnr * 2; |                       labelpositions.count := tai_label(p).labsym.labelnr * 2; | ||||||
|                     labelpositions[tai_label(p).l.labelnr] := pointer(instrpos); |                     labelpositions[tai_label(p).labsym.labelnr] := pointer(instrpos); | ||||||
|                   end; |                   end; | ||||||
|                 ait_instruction: |                 ait_instruction: | ||||||
|                   begin |                   begin | ||||||
|  | |||||||
| @ -73,7 +73,8 @@ interface | |||||||
|         'csect', {data} |         'csect', {data} | ||||||
|         'csect', {read only data} |         'csect', {read only data} | ||||||
|         'csect', {bss} 'csect', |         'csect', {bss} 'csect', | ||||||
|         'csect','csect','csect','csect','','','','','','','','','','','','','','' |         'csect','csect','csect','csect', | ||||||
|  |          '','','','','','','','','','','','' | ||||||
|       ); |       ); | ||||||
| 
 | 
 | ||||||
|     type |     type | ||||||
| @ -1050,9 +1051,9 @@ interface | |||||||
|               end; |               end; | ||||||
|             ait_label: |             ait_label: | ||||||
|               begin |               begin | ||||||
|                  if tai_label(hp).l.is_used then |                  if tai_label(hp).labsym.is_used then | ||||||
|                   begin |                   begin | ||||||
|                     s:= tai_label(hp).l.name; |                     s:= tai_label(hp).labsym.name; | ||||||
|                     if s[1] = '@' then |                     if s[1] = '@' then | ||||||
|                       begin |                       begin | ||||||
|                         ReplaceForbiddenChars(s); |                         ReplaceForbiddenChars(s); | ||||||
| @ -1129,7 +1130,7 @@ interface | |||||||
|         replaced: boolean; |         replaced: boolean; | ||||||
| 
 | 
 | ||||||
|       begin |       begin | ||||||
|         if tasmsymbol(p).defbind=AB_EXTERNAL then |         if tasmsymbol(p).bind=AB_EXTERNAL then | ||||||
|           begin |           begin | ||||||
|             //Writeln('ZZZ ',p.name,' ',p.classname,' ',Ord(tasmsymbol(p).typ)); |             //Writeln('ZZZ ',p.name,' ',p.classname,' ',Ord(tasmsymbol(p).typ)); | ||||||
|             s:= p.name; |             s:= p.name; | ||||||
|  | |||||||
| @ -2058,7 +2058,7 @@ const | |||||||
| 
 | 
 | ||||||
|          if (target_info.system = system_powerpc_darwin) and |          if (target_info.system = system_powerpc_darwin) and | ||||||
|             assigned(ref.symbol) and |             assigned(ref.symbol) and | ||||||
|             (ref.symbol.defbind = AB_EXTERNAL) then |             (ref.symbol.bind = AB_EXTERNAL) then | ||||||
|            begin |            begin | ||||||
|              tmpreg := g_darwin_indirect_sym_load(list,ref.symbol.name); |              tmpreg := g_darwin_indirect_sym_load(list,ref.symbol.name); | ||||||
|              if (ref.base = NR_NO) then |              if (ref.base = NR_NO) then | ||||||
|  | |||||||
| @ -236,8 +236,8 @@ interface | |||||||
|     {$ifndef NOAG386BIN} |     {$ifndef NOAG386BIN} | ||||||
|       public |       public | ||||||
|          { the next will reset all instructions that can change in pass 2 } |          { the next will reset all instructions that can change in pass 2 } | ||||||
|          procedure ResetPass1; |          procedure ResetPass1;override; | ||||||
|          procedure ResetPass2; |          procedure ResetPass2;override; | ||||||
|          function  CheckIfValid:boolean; |          function  CheckIfValid:boolean; | ||||||
|          function  Pass1(objdata:TObjData):longint;override; |          function  Pass1(objdata:TObjData):longint;override; | ||||||
|          procedure Pass2(objdata:TObjData);override; |          procedure Pass2(objdata:TObjData);override; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe