[m-rev.] diff: fix a bug in reassign.m

Zoltan Somogyi zs at cs.mu.OZ.AU
Sun Apr 14 14:06:41 AEST 2002


Estimated hours taken: 4
Branches: main

compiler/reassign.m:
	Fix a bug that caused the compiler to generate incorrect code
	if both --use-local-vars and --optimize-reassign were enabled.
	--use-local-vars generates references to temporaries. The bug
	was that after an instruction sequence such as the following one
	from parse_goal_with_purity:

		r3 = tempr1;
		tempr1 = r4;

	reassign.m thought that tempr1 still had the same value in it
	as r3. It effectively ignored the second assignment because it
	wasn't assigning to an lval of the right form. The fix is to include
	temporaries in the right forms.

Zoltan.

Index: compiler/reassign.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/reassign.m,v
retrieving revision 1.3
diff -u -b -r1.3 reassign.m
--- compiler/reassign.m	20 Mar 2002 12:37:16 -0000	1.3
+++ compiler/reassign.m	13 Apr 2002 18:47:43 -0000
@@ -341,6 +341,7 @@
 
 :- pred no_implicit_alias_target(lval::in) is semidet.
 
+no_implicit_alias_target(temp(_, _)).
 no_implicit_alias_target(reg(_, _)).
 no_implicit_alias_target(stackvar(_)).
 no_implicit_alias_target(framevar(_)).
--------------------------------------------------------------------------
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