[m-rev.] for review by Mark: 64 bit MR_LongLval

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Jan 8 18:46:47 AEDT 2007


Manual testing shows this allows the synth_attr test case to work on
saturn; a bootcheck is now in progress.

Zoltan.

Fix the failure of the user event related test cases on saturn and other
64 bit machines. The problem was that MR_LongLvals, which were 32 bits
in size, were being asked store pointers to closures, which on these
platforms are 64 bits. The fix is to make MR_LongLvals contain MR_Unsigneds,
whose size adjusts to the platform.

runtime/mercury_stack_layout.h:
	Make the change described above.

	Change the macros for looking up long and short lval descriptions
	to return the semantic types MR_LongLval and MR_ShortLval, not the
	physical types they are equivalent to. This will make similar problems
	easier to spot in future.

runtime/mercury_layout_util.c:
trace/mercury_trace.c:
	Conform to the change to mercury_stack_layout.h.

compiler/stack_layout.m:
	Give the size of the rvals represent MR_LongLvals as unsigned,
	not as uint_least32_t.

cvs diff: Diffing .
cvs diff: Diffing analysis
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/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/libatomic_ops-1.2
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/doc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/gcc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/hpc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/ibmc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/icc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/msftc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/src/atomic_ops/sysdeps/sunc
cvs diff: Diffing boehm_gc/libatomic_ops-1.2/tests
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing boehm_gc/windows-untested
cvs diff: Diffing boehm_gc/windows-untested/vc60
cvs diff: Diffing boehm_gc/windows-untested/vc70
cvs diff: Diffing boehm_gc/windows-untested/vc71
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
Index: compiler/stack_layout.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/stack_layout.m,v
retrieving revision 1.132
diff -u -b -r1.132 stack_layout.m
--- compiler/stack_layout.m	6 Jan 2007 10:56:16 -0000	1.132
+++ compiler/stack_layout.m	8 Jan 2007 06:55:10 -0000
@@ -1031,7 +1031,7 @@
         MaybeVarNum = yes(VarNum)
     ;
         MaybeAttr = no,
-        LocnRvalAndType = const(llconst_int(0)) - uint_least32,
+        LocnRvalAndType = const(llconst_int(0)) - unsigned,
         MaybeVarNum = no
     ),
     construct_user_data_array(VarNumMap, MaybeAttrs, LocnRvalAndTypes,
@@ -1075,7 +1075,7 @@
     construct_type_param_locn_vector(TVarLocns, 1, TypeParamLocs),
     list.length(TypeParamLocs, TypeParamsLength),
     LengthRval = const(llconst_int(TypeParamsLength)),
-    Vector = [LengthRval - uint_least32 | TypeParamLocs].
+    Vector = [LengthRval - unsigned | TypeParamLocs].
 
 %---------------------------------------------------------------------------%
 
@@ -1169,12 +1169,12 @@
         ),
         represent_locn_as_int_rval(Locn, Rval),
         construct_type_param_locn_vector(TVarLocns, NextSlot, VectorTail),
-        Vector = [Rval - uint_least32 | VectorTail]
+        Vector = [Rval - unsigned | VectorTail]
     ; TVarNum > CurSlot ->
         construct_type_param_locn_vector([TVar - Locns | TVarLocns], NextSlot,
             VectorTail),
         % This slot will never be referred to.
-        Vector = [const(llconst_int(0)) - uint_least32 | VectorTail]
+        Vector = [const(llconst_int(0)) - unsigned | VectorTail]
     ;
         unexpected(this_file,
             "unsorted tvars in construct_type_param_locn_vector")
@@ -1186,7 +1186,7 @@
     --->    live_array_info(
                 rval,       % Rval describing the location of a live value.
                             % Always of llds type uint_least8 if the cell
-                            % is in the byte array, and uint_least32 if it
+                            % is in the byte array, and unsigned if it
                             % is in the int array.
                 rval,       % Rval describing the type of a live value.
                 llds_type,  % The llds type of the rval describing the type.
@@ -1230,7 +1230,7 @@
 
     list.map(SelectTypes, AllArrayInfo, AllTypeRvalsTypes),
     list.map(SelectLocns, IntArrayInfo, IntLocns),
-    list.map(associate_type(uint_least32), IntLocns, IntLocnsTypes),
+    list.map(associate_type(unsigned), IntLocns, IntLocnsTypes),
     list.map(SelectLocns, ByteArrayInfo, ByteLocns),
     list.map(associate_type(uint_least8), ByteLocns, ByteLocnsTypes),
     list.append(IntLocnsTypes, ByteLocnsTypes, AllLocnsTypes),
@@ -1497,7 +1497,7 @@
     (
         LvalOrConst = lval(Lval),
         represent_locn_as_int_rval(locn_direct(Lval), Rval),
-        Type = uint_least32
+        Type = unsigned
     ;
         LvalOrConst = const(_Const),
         get_module_info(!.Info, ModuleInfo),
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing debian/patches
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/base64
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/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/error
cvs diff: Diffing extras/fixed
cvs diff: Diffing extras/gator
cvs diff: Diffing extras/gator/generations
cvs diff: Diffing extras/gator/generations/1
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/easyx
cvs diff: Diffing extras/graphics/easyx/samples
cvs diff: Diffing extras/graphics/mercury_glut
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/gears
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/lex/tests
cvs diff: Diffing extras/log4m
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/moose/tests
cvs diff: Diffing extras/mopenssl
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/net
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/solver_types
cvs diff: Diffing extras/solver_types/library
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/stream/tests
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/windows_installer_generator
cvs diff: Diffing extras/windows_installer_generator/sample
cvs diff: Diffing extras/windows_installer_generator/sample/images
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing extras/xml_stylesheets
cvs diff: Diffing java
cvs diff: Diffing java/runtime
cvs diff: Diffing library
cvs diff: Diffing mdbcomp
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
Index: runtime/mercury_layout_util.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_layout_util.c,v
retrieving revision 1.40
diff -u -b -r1.40 mercury_layout_util.c
--- runtime/mercury_layout_util.c	29 Nov 2006 05:18:23 -0000	1.40
+++ runtime/mercury_layout_util.c	8 Jan 2007 06:55:00 -0000
@@ -844,7 +844,8 @@
             printf("looking up long lval\n");
         }
 
-        long_locn.MR_long_lval = MR_long_desc_var_locn(label_layout, i);
+        long_locn.MR_long_lval =
+            MR_long_desc_var_locn(label_layout, i).MR_long_lval;
         *value = MR_lookup_long_lval_base(long_locn,
             saved_regs, base_sp, base_curfr, &succeeded);
     } else {
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.107
diff -u -b -r1.107 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	27 Dec 2006 04:16:37 -0000	1.107
+++ runtime/mercury_stack_layout.h	8 Jan 2007 06:55:00 -0000
@@ -87,7 +87,7 @@
 */
 
 /*
-** MR_LongLval is a MR_uint_least32_t which describes an location.
+** MR_LongLval is a MR_Unsigned which describes an location.
 ** This includes lvals such as stack slots, general registers, and special
 ** registers such as succip, hp, etc, as well as locations whose address is
 ** given as a typeinfo inside the type class info structure pointed to by an
@@ -131,7 +131,7 @@
 */
 
 struct MR_LongLval_Struct {
-	MR_uint_least32_t	MR_long_lval;
+	MR_Unsigned	MR_long_lval;
 };
 
 typedef enum {
@@ -518,11 +518,11 @@
 #define	MR_end_of_var_ptis(sll)						\
 		(&MR_var_pti((sll), MR_all_desc_var_count(sll)))
 #define	MR_long_desc_var_locn(sll, i)					\
-		(((MR_uint_least32_t *) MR_end_of_var_ptis(sll))[(i)])
+		(((MR_LongLval *) MR_end_of_var_ptis(sll))[(i)])
 #define	MR_end_of_long_desc_var_locns(sll)				\
 		(&MR_long_desc_var_locn((sll), MR_long_desc_var_count(sll)))
 #define	MR_short_desc_var_locn(sll, i)					\
-		(((MR_uint_least8_t *)					\
+		(((MR_ShortLval *)					\
 			MR_end_of_long_desc_var_locns(sll))		\
 				[((i) - MR_long_desc_var_count(sll))])
 
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 samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing slice
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/string_format
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/grade_subdirs
cvs diff: Diffing tests/hard_coded
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/mmc_make
cvs diff: Diffing tests/mmc_make/lib
cvs diff: Diffing tests/par_conj
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/trailing
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
Index: trace/mercury_trace.c
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/trace/mercury_trace.c,v
retrieving revision 1.103
diff -u -b -r1.103 mercury_trace.c
--- trace/mercury_trace.c	3 Jan 2007 05:17:20 -0000	1.103
+++ trace/mercury_trace.c	8 Jan 2007 06:55:18 -0000
@@ -779,7 +779,8 @@
             if (i < MR_long_desc_var_count(call_label)) {
                 MR_LongLval     long_locn;
 
-                long_locn.MR_long_lval = MR_long_desc_var_locn(call_label, i);
+                long_locn.MR_long_lval =
+                    MR_long_desc_var_locn(call_label, i).MR_long_lval;
                 arg_num = MR_get_register_number_long(long_locn);
             } else {
                 MR_ShortLval    short_locn;
@@ -1328,7 +1329,7 @@
                 MR_LongLval     long_locn;
 
                 long_locn.MR_long_lval =
-                    MR_long_desc_var_locn(label_layout, i);
+                    MR_long_desc_var_locn(label_layout, i).MR_long_lval;
                 return MR_lookup_long_lval_base(long_locn,
                     saved_regs, base_sp, base_curfr, succeeded);
             } else {
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list