for review: bug fix in value numbering

Zoltan Somogyi zs at cs.mu.OZ.AU
Fri Sep 18 19:30:51 AEST 1998


Simon reported the problem, maybe he'd like to review it.

Estimated hours taken: 1

compiler/vn_block.m:
	Fix a bug in value numbering.

	The test case is tests/ctrl/nondet_ctrl_vn, at -O5 on cyclone.
	(On some other machines (e.g. hydra), the bug does not show up
	even when it is present.)

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing bytecode/test
cvs diff: Diffing compiler
Index: compiler/vn_block.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/vn_block.m,v
retrieving revision 1.57
diff -u -u -r1.57 vn_block.m
--- vn_block.m	1998/08/26 07:51:12	1.57
+++ vn_block.m	1998/09/16 06:51:02
@@ -205,18 +205,32 @@
 	vn_table__set_desired_value(Vnlval, Vn, VnTables2, VnTables),
 	vn_util__find_specials(Vnlval, LeftSpecials),
 	(
-		% Assignments of this form occur in hijacking.
-		% We must record the left hand side (which will be a stackvar
-		% or framevar) as a must flush location, because liveness will
-		% not force it to be flushed. The reason for this is that
-		% we do not properly include temporary slots (such as those
-		% used by hijacking) in livevals annotations.
-		Rval = lval(SubLval),
-		( SubLval = curfr
-		; SubLval = maxfr
-		; SubLval = redoip(_)
-		; SubLval = redofr(_)
-		)
+		% % Assignments of this form occur in hijacking.
+		% % We must record the left hand side (which will be a stackvar
+		% % or framevar) as a must flush location, because liveness will
+		% % not force it to be flushed. The reason for this is that
+		% % we do not properly include temporary slots (such as those
+		% % used by hijacking) in livevals annotations.
+		% Rval = lval(SubLval),
+		% ( SubLval = curfr
+		% ; SubLval = maxfr
+		% ; SubLval = redoip(_)
+		% ; SubLval = redofr(_)
+		% )
+
+		% Before we leave a disjunction through a non-last disjunct,
+		% the code generator makes sure that the variables needed
+		% on resumption at the next disjunct are in their stack slots.
+		% The resumption point may be reached via a redo() or fail()
+		% operation. Unfortunately, livemap.m does not recognize that
+		% these stack variables are live at points that perform a
+		% redo() or fail() operation. We compensate here by ensuring
+		% that assignments to stack variables are not removed by
+		% value numbering.
+		%
+		% The condition of this test subsumes the condition that used
+		% to be here, which is therefore commented out above.
+		( Lval = stackvar(_) ; Lval = framevar(_) )
 	->
 		Specials = [Vnlval | LeftSpecials]
 	;
cvs diff: Diffing compiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/exceptions
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/Togl-1.2
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing library
cvs diff: Diffing lp_solve
cvs diff: Diffing lp_solve/lp_examples
cvs diff: Diffing profiler
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/general
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trial
cvs diff: Diffing util



More information about the developers mailing list