[m-rev.] C# bootcheck

Julien Fischer jfischer at opturion.com
Wed Jun 19 10:49:40 AEST 2019


On Tue, 18 Jun 2019, Zoltan Somogyi wrote:

> On Tue, 18 Jun 2019 20:43:37 +1000, Peter Wang <novalazy at gmail.com> wrote:

>> The behaviour of output_int_const_for_{java,csharp} depends on the width
>> of the Mercury `int' type, for the reason given in the comment in
>> output_int_const_for_java.
>
> That can't be the whole story, because those two predicates do exactly the same test
> (In Mercury, that is), yet the mismatch between stages 2 and 3 occurs only for C#, and
> NOT for Java. At least that is the way it is on my new laptop. How is it on your machines?

I *do* get them for the Java grade on my machine.  In fact there are
three classes of difference I get:

1. With the printing of float constants in some spots.

--- stage2/library/Mercury/javas/jmercury/hash_table.java
2019-06-18 23:49:59.057617729 +1000
+++ stage3/library/Mercury/javas/jmercury/hash_table.java
2019-06-19 00:05:39.139893219 +1000
@@ -6107,7 +6107,7 @@
        hash_table.Hash_table_2 HT_6 = null;
        hash_table.Hash_table_2 Var_7 = null;
        int Var_11 = 7;
-      double Var_12 = 0.90000000000000002;
+      double Var_12 = 0.90000000000000000;

2. In the sparse_bitset and tree_bitset modules.

--- stage2/library/Mercury/javas/jmercury/sparse_bitset.java
2019-06-18 23:50:33.476554648 +1000
+++ stage3/library/Mercury/javas/jmercury/sparse_bitset.java
2019-06-19 00:09:44.839423103 +1000
@@ -733,15 +733,11 @@
              int Var_16 = ((sparse_bitset.Bitset_elem_0) Data_5).bits;
              int Var_17 = 0;
              int Var_18 = 0;
-            int Var_19 = 0;
-            int Var_20 = 0;
+            int Var_19 = -1;
              int Var_21 = 0;
-            int Var_22 = 0;
-            int Var_23 = 0;
+            int Var_22 = (Index_2 - Offset_9);
+            int Var_23 = 1;

-            Var_19 = ~(Var_20);
-            Var_22 = (Index_2 - Offset_9);
-            Var_23 = 1;
              Var_21 = (Var_22 + Var_23);
              Var_18 = (Var_19 << Var_21);
              Var_17 = ~(Var_18);

3. And the issue with integer contstants.

---
stage2/compiler/Mercury/javas/jmercury/ml_backend__mlds_to_java_data.java
2019-06-18 23:53:33.371224635 +1000
+++
stage3/compiler/Mercury/javas/jmercury/ml_backend__mlds_to_java_data.java
2019-06-19 00:37:11.786179066 +1000
@@ -12012,7 +12012,7 @@
        if (succeeded)
        {
          int Var_15 = 0;
-        int Var_16 = 0xffffffff;
+        int Var_16 = -1;
          java.lang.String Var_20 = null;
          java.lang.String Var_21 = null;
          string__parse_util.String_format_flags_0 Var_27 = null;

Julien.


More information about the reviews mailing list