mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 13:31:40 +01:00 
			
		
		
		
	* tcgx86_64.g_proc_exit: restore stack pointer using value that was calculated and stored in tcgx86.g_proc_entry, instead of recalculating it again.
git-svn-id: trunk@20078 -
This commit is contained in:
		
							parent
							
								
									149218408b
								
							
						
					
					
						commit
						fde1695961
					
				| @ -177,7 +177,6 @@ unit cgcpu; | |||||||
| 
 | 
 | ||||||
|     procedure tcgx86_64.g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean); |     procedure tcgx86_64.g_proc_exit(list : TAsmList;parasize:longint;nostackframe:boolean); | ||||||
|       var |       var | ||||||
|         stacksize : longint; |  | ||||||
|         href : treference; |         href : treference; | ||||||
|       begin |       begin | ||||||
|         { Release PIC register } |         { Release PIC register } | ||||||
| @ -189,16 +188,8 @@ unit cgcpu; | |||||||
|           begin |           begin | ||||||
|             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) then |             if (current_procinfo.framepointer=NR_STACK_POINTER_REG) then | ||||||
|               begin |               begin | ||||||
|                 stacksize:=current_procinfo.calc_stackframe_size; |                 if (current_procinfo.final_localsize<>0) then | ||||||
|                 if (target_info.system in systems_need_16_byte_stack_alignment) and |                   cg.a_op_const_reg(list,OP_ADD,OS_ADDR,current_procinfo.final_localsize,NR_STACK_POINTER_REG); | ||||||
|                    ((stacksize <> 0) or |  | ||||||
|                     (pi_do_call in current_procinfo.flags) or |  | ||||||
|                     { can't detect if a call in this case -> use nostackframe } |  | ||||||
|                     { if you (think you) know what you are doing              } |  | ||||||
|                     (po_assembler in current_procinfo.procdef.procoptions)) then |  | ||||||
|                   stacksize := align(stacksize+sizeof(aint),16) - sizeof(aint); |  | ||||||
|                 if (stacksize<>0) then |  | ||||||
|                   cg.a_op_const_reg(list,OP_ADD,OS_ADDR,stacksize,current_procinfo.framepointer); |  | ||||||
|               end |               end | ||||||
|             else if (target_info.system=system_x86_64_win64) then |             else if (target_info.system=system_x86_64_win64) then | ||||||
|               begin |               begin | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 sergei
						sergei