mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 11:39:40 +01:00 
			
		
		
		
	Fix bug in gen_load_cgpara_loc for 64bit registers on 8bit architectures.
Added a workaround in a_load_const_reg to allow compilation for AVR. git-svn-id: trunk@32090 -
This commit is contained in:
		
							parent
							
								
									3fcbb7d2d4
								
							
						
					
					
						commit
						14020b044c
					
				@ -968,7 +968,12 @@ unit cgcpu;
 | 
				
			|||||||
             if ((qword(a) and mask) shr shift)=0 then
 | 
					             if ((qword(a) and mask) shr shift)=0 then
 | 
				
			||||||
               emit_mov(list,reg,NR_R1)
 | 
					               emit_mov(list,reg,NR_R1)
 | 
				
			||||||
             else
 | 
					             else
 | 
				
			||||||
               list.concat(taicpu.op_reg_const(A_LDI,reg,(qword(a) and mask) shr shift));
 | 
					               begin
 | 
				
			||||||
 | 
					                 getcpuregister(list,NR_R26);
 | 
				
			||||||
 | 
					                 list.concat(taicpu.op_reg_const(A_LDI,NR_R26,(qword(a) and mask) shr shift));
 | 
				
			||||||
 | 
					                 a_load_reg_reg(list,OS_8,OS_8,NR_R26,reg);
 | 
				
			||||||
 | 
					                 ungetcpuregister(list,NR_R26);
 | 
				
			||||||
 | 
					               end;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
             mask:=mask shl 8;
 | 
					             mask:=mask shl 8;
 | 
				
			||||||
             inc(shift,8);
 | 
					             inc(shift,8);
 | 
				
			||||||
 | 
				
			|||||||
@ -930,7 +930,7 @@ implementation
 | 
				
			|||||||
                                unget_para(curparaloc^.next^.next^);
 | 
					                                unget_para(curparaloc^.next^.next^);
 | 
				
			||||||
                                cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^,GetNextReg(GetNextReg(destloc.register64.reglo)),1);
 | 
					                                cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^,GetNextReg(GetNextReg(destloc.register64.reglo)),1);
 | 
				
			||||||
                                unget_para(curparaloc^.next^.next^.next^);
 | 
					                                unget_para(curparaloc^.next^.next^.next^);
 | 
				
			||||||
                                cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^,GetNextReg(GetNextReg(GetNextReg(destloc.register64.reglo))),1);
 | 
					                                cg.a_load_cgparaloc_anyreg(list,OS_8,curparaloc^.next^.next^.next^,GetNextReg(GetNextReg(GetNextReg(destloc.register64.reglo))),1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                curparaloc:=paraloc^.next^.next^.next^.next;
 | 
					                                curparaloc:=paraloc^.next^.next^.next^.next;
 | 
				
			||||||
                                unget_para(curparaloc^);
 | 
					                                unget_para(curparaloc^);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user