[m-rev.] diff: fix tail call outputing bug

Peter Ross peter.ross at miscrit.be
Sat Feb 9 00:54:47 AEDT 2002


Hi,


===================================================================


Estimated hours taken: 1
Branches: main

compiler/mlds_to_il.m:
    The callee return type must be compatible with the caller return
    type for a tail call on the IL backend, not just for verifiable code
    but for any code.

Index: mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.101
diff -u -r1.101 mlds_to_il.m
--- mlds_to_il.m	8 Feb 2002 10:29:01 -0000	1.101
+++ mlds_to_il.m	8 Feb 2002 13:47:42 -0000
@@ -1539,13 +1539,10 @@
 			),
 			{ ByRefTailCalls = no }
 		),
-		% if --verifiable-code is enabled, then we must not output
-		% the "tail." prefix unless the callee return type is
-		% compatible with the caller return type
-		\+ (
-			{ VerifiableCode = yes },
-			{ ReturnParam \= CallerReturnParam }
-		)
+		% We must not output the "tail." prefix unless the
+		% callee return type is compatible with the caller
+		% return type
+		{ ReturnParam = CallerReturnParam }
 	->
 		{ TailCallInstrs = [tailcall] },
 		% For calls marked with "tail.", we need a `ret'

--------------------------------------------------------------------------
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