summaryrefslogtreecommitdiff
path: root/compiler/rgobj.pas
diff options
context:
space:
mode:
authorflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-08-28 18:49:04 +0000
committerflorian <florian@3ad0048d-3df7-0310-abae-a5850022a9f2>2015-08-28 18:49:04 +0000
commit1ff69dfc62fdb2a797c9224138aa92fe54c9a922 (patch)
treeb2f1a225f69d75df97873cc32e85824433bee35d /compiler/rgobj.pas
parentb47a58ddb0cfaf9ea57129d673e9c19c08367327 (diff)
downloadfpc-1ff69dfc62fdb2a797c9224138aa92fe54c9a922.tar.gz
* fix wrong comparisons in trgobj.conservative to enable better coalescing,
before this patch, k was calculated wrong most of the time git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@31439 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'compiler/rgobj.pas')
-rw-r--r--compiler/rgobj.pas11
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rgobj.pas b/compiler/rgobj.pas
index cf0d5d50ae..8f3673d454 100644
--- a/compiler/rgobj.pas
+++ b/compiler/rgobj.pas
@@ -21,10 +21,11 @@
{$i fpcdefs.inc}
+{ $define DEBUG_REGALLOC}
+
{ Allow duplicate allocations, can be used to get the .s file written }
{ $define ALLOWDUPREG}
-
unit rgobj;
interface
@@ -577,9 +578,9 @@ unit rgobj;
insert_regalloc_info_all(list);
ibitmap:=tinterferencebitmap.create;
generate_interference_graph(list,headertai);
-{$ifdef DEBUG_SSA}
+{$ifdef DEBUG_REGALLOC}
writegraph(rtindex);
-{$endif DEBUG_SSA}
+{$endif DEBUG_REGALLOC}
inc(rtindex);
{ Don't do the real allocation when -sr is passed }
if (cs_no_regalloc in current_settings.globalswitches) then
@@ -1116,7 +1117,7 @@ unit rgobj;
for i:=1 to adj^.length do
begin
n:=adj^.buf^[i-1];
- if flags*[ri_coalesced,ri_selected]=[] then
+ if reginfo[n].flags*[ri_coalesced,ri_selected]=[] then
begin
supregset_include(done,n);
if reginfo[n].degree>=usable_registers_cnt then
@@ -1131,7 +1132,7 @@ unit rgobj;
n:=adj^.buf^[i-1];
if not supregset_in(done,n) and
(reginfo[n].degree>=usable_registers_cnt) and
- (reginfo[u].flags*[ri_coalesced,ri_selected]=[]) then
+ (reginfo[n].flags*[ri_coalesced,ri_selected]=[]) then
inc(k);
end;
conservative:=(k<usable_registers_cnt);