mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 13:39:39 +01:00 
			
		
		
		
	* set index register correctly * index register might not be changed
git-svn-id: trunk@22229 -
This commit is contained in:
		
							parent
							
								
									245d8286d5
								
							
						
					
					
						commit
						58a85e79ce
					
				@ -380,7 +380,10 @@ Implementation
 | 
			
		||||
        (taicpu(hp1).oper[1]^.reg=p.oper[1]^.ref^.base) and
 | 
			
		||||
        { don't apply the optimization if the base register is loaded }
 | 
			
		||||
        (p.oper[0]^.reg<>p.oper[1]^.ref^.base) and
 | 
			
		||||
        not(RegModifiedBetween(taicpu(hp1).oper[0]^.reg,p,hp1)) then
 | 
			
		||||
        not(RegModifiedBetween(taicpu(hp1).oper[0]^.reg,p,hp1)) and
 | 
			
		||||
        { don't apply the optimization if the (new) index register is loaded }
 | 
			
		||||
        (p.oper[0]^.reg<>taicpu(hp1).oper[2]^.reg) and
 | 
			
		||||
        not(RegModifiedBetween(taicpu(hp1).oper[2]^.reg,p,hp1)) then
 | 
			
		||||
        begin
 | 
			
		||||
          DebugMsg('Peephole Str/LdrAdd/Sub2Str/Ldr Postindex done', p);
 | 
			
		||||
          p.oper[1]^.ref^.addressmode:=AM_POSTINDEXED;
 | 
			
		||||
@ -393,7 +396,7 @@ Implementation
 | 
			
		||||
            end
 | 
			
		||||
          else
 | 
			
		||||
            begin
 | 
			
		||||
              p.oper[1]^.ref^.index:=taicpu(hp1).oper[1]^.reg;
 | 
			
		||||
              p.oper[1]^.ref^.index:=taicpu(hp1).oper[2]^.reg;
 | 
			
		||||
              if taicpu(hp1).opcode=A_ADD then
 | 
			
		||||
                p.oper[1]^.ref^.signindex:=1
 | 
			
		||||
              else
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user