From 31fddaafe8d87c6c76959d61e0ea52d03b4dfbc0 Mon Sep 17 00:00:00 2001 From: sergei Date: Wed, 25 Feb 2015 21:38:23 +0000 Subject: [PATCH] + New subtype of tai_regalloc, "ra_markused". It marks a physical register as used in procedure, triggering saving/restoring that register if it is non-volatile. git-svn-id: trunk@30010 - --- compiler/aasmtai.pas | 14 ++++++++++++-- compiler/rgobj.pas | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index e300156ea3..66fd079da3 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -334,7 +334,7 @@ interface mark_Position ); - TRegAllocType = (ra_alloc,ra_dealloc,ra_sync,ra_resize); + TRegAllocType = (ra_alloc,ra_dealloc,ra_sync,ra_resize,ra_markused); TStabType = (stab_stabs,stab_stabn,stab_stabd, { AIX/XCOFF stab types } @@ -371,7 +371,7 @@ interface const - regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized'); + regallocstr : array[tregalloctype] of string[10]=('allocated','released','sync','resized','used'); tempallocstr : array[boolean] of string[10]=('released','allocated'); stabtypestr : array[TStabType] of string[8]=( 'stabs','stabn','stabd', @@ -714,6 +714,7 @@ interface constructor dealloc(r : tregister;ainstr:tai); constructor sync(r : tregister); constructor resize(r : tregister); + constructor markused(r : tregister); constructor ppuload(t:taitype;ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override; end; @@ -2424,6 +2425,15 @@ implementation end; + constructor tai_regalloc.markused(r : tregister); + begin + inherited create; + typ:=ait_regalloc; + ratype:=ra_markused; + reg:=r; + end; + + constructor tai_regalloc.ppuload(t:taitype;ppufile:tcompilerppufile); begin inherited ppuload(t,ppufile); diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas index 57861897be..f415b3d7b2 100644 --- a/compiler/rgobj.pas +++ b/compiler/rgobj.pas @@ -1683,6 +1683,9 @@ unit rgobj; {$endif DEBUG_REGISTERLIFE} add_edges_used(supreg); end; + ra_markused : + if (supreg