[m-rev.] diff: fix debug grade problems on 64 bit machines

Zoltan Somogyi zs at csse.unimelb.edu.au
Mon Nov 9 19:08:43 AEDT 2009


This diff fixes the problems on 64 bit machines; I am testing it now
whether it causes any problems on 32 bit machines.

There are also 32-vs-64 bit problems in robdd/bryant.c, so I expect
that the robdd based mode constraint checker isn't currently working
on 64 bit machines, but that (a) isn't urgent, and (b) isn't my fault,
having been in the code since its creation.

Zoltan.

Fix the bug that caused problems in debug grades on 64 bit machines,
as well as some related warnings from the C compiler.

runtime/mercury_stack_layout.h:
	Make MR_LongLvals word size on 64 bit machines as well as 32 bit
	machines.

compiler/layout_out.m:
	Cast some rvals to the expected type.

compiler/llds_out_global.m:
	Don't put & before the names of globals that are already arrays,
	and hence addresses.

cvs diff: Diffing compiler
Index: compiler/layout_out.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/layout_out.m,v
retrieving revision 1.106
diff -u -b -r1.106 layout_out.m
--- compiler/layout_out.m	4 Nov 2009 03:44:47 -0000	1.106
+++ compiler/layout_out.m	9 Nov 2009 04:08:05 -0000
@@ -771,6 +771,7 @@
                 i(PTIsSlot), i(HLDSVarNumsSlot), i(ShortLocnsSlot)], !IO)
         )
     ;
+        io.write_string("(const MR_TypeParamLocns *) ", !IO),
         output_rval_as_addr(Info, TypeParams, !IO),
         io.write_string(",", !IO),
         ( PTIsSlot >= 0 ->
@@ -876,6 +877,7 @@
                 i(ShortLocnsSlot), i(LongLocnsSlot)], !IO)
         )
     ;
+        io.write_string("(const MR_TypeParamLocns *) ", !IO),
         output_rval_as_addr(Info, TypeParams, !IO),
         io.write_string(",", !IO),
         ( PTIsSlot >= 0 ->
Index: compiler/llds_out_global.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/llds_out_global.m,v
retrieving revision 1.1
diff -u -b -r1.1 llds_out_global.m
--- compiler/llds_out_global.m	4 Nov 2009 03:44:48 -0000	1.1
+++ compiler/llds_out_global.m	9 Nov 2009 05:08:23 -0000
@@ -231,14 +231,14 @@
     io.write_string(",\n", !IO),
     io.write_string("{ 0 },\n", !IO),
     io.write_string("{\n", !IO),
-    output_data_id_addr(Info, InputStepsDataId, !IO),
+    output_data_id(Info, InputStepsDataId, !IO),
     io.write_string(",\n", !IO),
     (
         MaybeOutputSteps = no,
         io.write_string("NULL\n", !IO)
     ;
         MaybeOutputSteps = yes(_),
-        output_data_id_addr(Info, OutputStepsDataId, !IO),
+        output_data_id(Info, OutputStepsDataId, !IO),
         io.write_string("\n", !IO)
     ),
     io.write_string("},\n", !IO),
@@ -266,12 +266,12 @@
         io.write_string("{{{\n", !IO),
         io.write_string("0,\n", !IO),
         io.write_string("0,\n", !IO),
-        output_data_id_addr(Info, CallStatsDataId, !IO),
+        output_data_id(Info, CallStatsDataId, !IO),
         io.write_string("\n", !IO),
         io.write_string("},{\n", !IO),
         io.write_string("0,\n", !IO),
         io.write_string("0,\n", !IO),
-        output_data_id_addr(Info, PrevCallStatsDataId, !IO),
+        output_data_id(Info, PrevCallStatsDataId, !IO),
         io.write_string("\n", !IO),
         io.write_string("}},{{\n", !IO),
         (
@@ -287,12 +287,12 @@
             MaybeOutputSteps = yes(_),
             io.write_string("0,\n", !IO),
             io.write_string("0,\n", !IO),
-            output_data_id_addr(Info, AnswerStatsDataId, !IO),
+            output_data_id(Info, AnswerStatsDataId, !IO),
             io.write_string("\n", !IO),
             io.write_string("},{\n", !IO),
             io.write_string("0,\n", !IO),
             io.write_string("0,\n", !IO),
-            output_data_id_addr(Info, PrevAnswerStatsDataId, !IO),
+            output_data_id(Info, PrevAnswerStatsDataId, !IO),
             io.write_string("\n", !IO)
         ),
         io.write_string("}}},\n", !IO)
cvs diff: Diffing compiler/notes
cvs diff: Diffing runtime
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.118
diff -u -b -r1.118 mercury_stack_layout.h
--- runtime/mercury_stack_layout.h	30 Oct 2009 03:33:29 -0000	1.118
+++ runtime/mercury_stack_layout.h	9 Nov 2009 01:20:00 -0000
@@ -90,7 +90,7 @@
 */
 
 /*
-** MR_LongLval is a MR_int_least32_t which describes a location.
+** MR_LongLval is an MR_Unsigned which describes a 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
@@ -132,7 +132,7 @@
 ** which must be kept in sync with the constants and macros defined here.
 */
 
-typedef MR_uint_least32_t   MR_LongLval;
+typedef MR_Unsigned MR_LongLval;
 
 typedef enum {
     MR_LONG_LVAL_TYPE_CONS_0,
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
--------------------------------------------------------------------------
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