[m-dev.] Re: code generator abort
Zoltan Somogyi
zs at cs.mu.OZ.AU
Mon Sep 11 15:18:23 AEDT 2000
On 07-Sep-2000, Thomas Conway <conway at cs.mu.OZ.AU> wrote:
> The code generator aborts compiling the icfp2000 code on roy.
> That is using the current sources, which compile at -O6 with
> intermodule optimization.
> It dies compiling vector.m
> Compilation succeeds at default optimization with intermodule
> optimization turned off.
For review by Tom.
compiler/code_exprn.m:
Fix an old bug: the code for allocating spare registers was using a
different and more liberal test for a register being free than the
code for assigning to that register. This bug caused a code generator
abort on the icfp2000 entry at -O6 with intermodule optimization.
Zoltan.
cvs diff: Diffing .
Index: code_exprn.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/code_exprn.m,v
retrieving revision 1.62
diff -u -r1.62 code_exprn.m
--- code_exprn.m 2000/09/04 22:33:26 1.62
+++ code_exprn.m 2000/09/09 05:31:13
@@ -1715,28 +1715,19 @@
exprn_info, exprn_info).
:- mode code_exprn__get_spare_reg_start_from(in, in, out, in, out) is det.
-code_exprn__get_spare_reg_start_from(RegType, N, Lval) -->
- code_exprn__get_regs(Regs),
- { code_exprn__get_spare_reg_2(RegType, N, Regs, Lval) }.
+code_exprn__get_spare_reg_start_from(RegType, N0, Lval) -->
+ { TrialLval = reg(RegType, N0) },
+ ( code_exprn__lval_in_use(TrialLval) ->
+ code_exprn__get_spare_reg_start_from(RegType, N0 + 1, Lval)
+ ;
+ { Lval = TrialLval }
+ ).
:- pred code_exprn__get_spare_reg(reg_type, lval, exprn_info, exprn_info).
:- mode code_exprn__get_spare_reg(in, out, in, out) is det.
code_exprn__get_spare_reg(RegType, Lval) -->
- code_exprn__get_regs(Regs),
- { code_exprn__get_spare_reg_2(RegType, 1, Regs, Lval) }.
-
-:- pred code_exprn__get_spare_reg_2(reg_type, int, bag(lval), lval).
-:- mode code_exprn__get_spare_reg_2(in, in, in, out) is det.
-
-code_exprn__get_spare_reg_2(RegType, N0, Regs, Lval) :-
- TrialLval = reg(RegType, N0),
- ( bag__contains(Regs, TrialLval) ->
- N1 is N0 + 1,
- code_exprn__get_spare_reg_2(RegType, N1, Regs, Lval)
- ;
- Lval = TrialLval
- ).
+ code_exprn__get_spare_reg_start_from(RegType, 1, Lval).
%------------------------------------------------------------------------------%
cvs diff: Diffing notes
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list