[m-rev.] RTTI bug & type specialization

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Dec 19 04:15:58 AEDT 2003


Estimated hours taken: 1
Branches: main

Work around an RTTI bug which was causing problems for accurate gc bug.

compiler/handle_options.m:
	Disable type specialization, since this can create type class
	constraints on compound non-ground types, which the current
	RTTI system can't handle.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: compiler/handle_options.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/handle_options.m,v
retrieving revision 1.193
diff -u -d -r1.193 handle_options.m
--- compiler/handle_options.m	1 Dec 2003 15:55:34 -0000	1.193
+++ compiler/handle_options.m	18 Dec 2003 11:36:29 -0000
@@ -929,6 +929,12 @@
 	% (in the type_info_varmap) occurs to the right of X in the
 	% procedure's parameter list.
 	%
+	% XXX we also disable type specialization.
+	% This is needed because type specialization may create
+	% type class constraints of the form `c(t(T))'
+	% (e.g. `enum(var(T))' in library/sparse_bitset.m),
+	% which the current RTTI system can't handle.
+	%
 	( { GC_Method = accurate } ->
 		globals__io_set_option(agc_stack_layout, bool(yes)),
 		globals__io_set_option(body_typeinfo_liveness, bool(yes)),
@@ -940,7 +946,13 @@
 			reclaim_heap_on_semidet_failure, bool(no)),
 		globals__io_set_option(
 			reclaim_heap_on_nondet_failure, bool(no)),
-		option_implies(highlevel_code, optimize_higher_order, bool(no))
+
+		option_implies(highlevel_code, optimize_higher_order,
+			bool(no)),
+
+		globals__io_set_option(type_specialization, bool(no)),
+		globals__io_set_option(user_guided_type_specialization,
+			bool(no))
 	;
 		[]
 	),

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list