mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-10-31 08:31:49 +01:00 
			
		
		
		
	* turned {$ifdef cputargethasfixedstack} into "if use_fixed_stack"
* fixed i386 parameter passing of function calls nested in parameters
    of functions which also need the stack to pass poarameters
git-svn-id: trunk@2847 -
			
			
This commit is contained in:
		
							parent
							
								
									41eba7dffe
								
							
						
					
					
						commit
						fad5d59bd9
					
				| @ -194,8 +194,13 @@ uses | ||||
| {$ifdef i386} | ||||
|         result := (target_info.system = system_i386_darwin); | ||||
| {$else i386} | ||||
| {$ifdef cputargethasfixedstack} | ||||
|         result := true; | ||||
| {$else cputargethasfixedstack} | ||||
|         result := false; | ||||
| {$endif cputargethasfixedstack} | ||||
| {$endif i386} | ||||
|       end; | ||||
| 
 | ||||
| end. | ||||
| 
 | ||||
|  | ||||
| @ -618,7 +618,8 @@ unit cpupara; | ||||
|       begin | ||||
|         paraloc:=parasym.paraloc[callerside].location; | ||||
|         { No need for temps when value is pushed } | ||||
|         if assigned(paraloc) and | ||||
|         if not(use_fixed_stack) and | ||||
|            assigned(paraloc) and | ||||
|            (paraloc^.loc=LOC_REFERENCE) and | ||||
|            (paraloc^.reference.index=NR_STACK_POINTER_REG) then | ||||
|           duplicateparaloc(list,calloption,parasym,cgpara) | ||||
|  | ||||
| @ -166,7 +166,8 @@ implementation | ||||
|              LOC_CREFERENCE : | ||||
|                begin | ||||
|                  size:=align(left.resulttype.def.size,tempcgpara.alignment); | ||||
|                  if tempcgpara.location^.reference.index=NR_STACK_POINTER_REG then | ||||
|                  if (not use_fixed_stack) and | ||||
|                     (tempcgpara.location^.reference.index=NR_STACK_POINTER_REG) then | ||||
|                    cg.a_param_ref(exprasmlist,left.location.size,left.location.reference,tempcgpara) | ||||
|                  else | ||||
|                    begin | ||||
| @ -696,10 +697,8 @@ implementation | ||||
|          callerparaloc, | ||||
|          tmpparaloc : pcgparalocation; | ||||
|          sizeleft: aint; | ||||
| {$ifdef cputargethasfixedstack} | ||||
|          htempref, | ||||
|          href : treference; | ||||
| {$endif cputargethasfixedstack} | ||||
|        begin | ||||
|          { copy all resources to the allocated registers } | ||||
|          ppn:=tcgcallparanode(left); | ||||
| @ -750,7 +749,8 @@ implementation | ||||
|                          end; | ||||
|                        LOC_REFERENCE: | ||||
|                          begin | ||||
| {$ifdef cputargethasfixedstack} | ||||
|                            if use_fixed_stack then | ||||
|                              begin | ||||
|                                { Can't have a data copied to the stack, every location | ||||
|                                  must contain a valid size field } | ||||
| 
 | ||||
| @ -780,7 +780,7 @@ implementation | ||||
|                                 else | ||||
|                                   internalerror(200402081); | ||||
|                              end; | ||||
| {$endif cputargethasfixedstack} | ||||
|                            end; | ||||
|                          end; | ||||
|                      end; | ||||
|                      dec(sizeleft,tcgsize2size[tmpparaloc^.size]); | ||||
|  | ||||
| @ -200,9 +200,8 @@ implementation | ||||
|           LOC_REFERENCE, | ||||
|           LOC_CREFERENCE : | ||||
|             begin | ||||
| {$ifdef cputargethasfixedstack} | ||||
|               if use_fixed_stack then | ||||
|                 location_freetemp(list,location); | ||||
| {$endif cputargethasfixedstack} | ||||
|             end; | ||||
|           else | ||||
|             internalerror(2004110211); | ||||
|  | ||||
| @ -251,9 +251,7 @@ implementation | ||||
|     procedure tparamanager.freeparaloc(list: taasmoutput; const cgpara: TCGPara); | ||||
|       var | ||||
|         paraloc : Pcgparalocation; | ||||
| {$ifdef cputargethasfixedstack} | ||||
|         href : treference; | ||||
| {$endif cputargethasfixedstack} | ||||
|       begin | ||||
|         paraloc:=cgpara.location; | ||||
|         while assigned(paraloc) do | ||||
| @ -282,13 +280,14 @@ implementation | ||||
|               LOC_REFERENCE, | ||||
|               LOC_CREFERENCE : | ||||
|                 begin | ||||
| {$ifdef cputargethasfixedstack} | ||||
|                   if use_fixed_stack then | ||||
|                     begin | ||||
|                       { don't use reference_reset_base, because that will depend on cgobj } | ||||
|                       fillchar(href,sizeof(href),0); | ||||
|                       href.base:=paraloc^.reference.index; | ||||
|                       href.offset:=paraloc^.reference.offset; | ||||
|                       tg.ungettemp(list,href); | ||||
| {$endif cputargethasfixedstack} | ||||
|                     end; | ||||
|                 end; | ||||
|               else | ||||
|                 internalerror(2004110212); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jonas Maebe
						Jonas Maebe