Created attachment 6548[details]
test program + environment
I am running mono 3.2.6 on osx (the official distribution, 32bit) and encountering a problem when optimized with LLVM. I reduced a real application into the smallest possible form to elicit this behavior (included). The nature of the problem is as follows:
- instantiate a class with a combination of doubles, longs and references
- inspect a long property on the class
- the value in the property does not match the value provided in the ctor
Depending on how the ctor was called, this will present a proper outcome or not. The code works properly in both code paths with native JIT but fails with LLVM jit.
Note that this worked fine for me on linux (64 bit) and failed on osx (32bit).
The scenarios are as follows, 1st the context:
var time = 1114459100000L;
var priorbar = new TrimmedBar (instrument, time, period, 66.755, 66.755, 66.755, 66.755, 0);
This scenario fails and throws the exception:
var filler = new TrimmedBar (instrument, time, period, priorbar.Close, priorbar.Close, priorbar.Close, priorbar.Close, 0);
if (filler.TimeStamp != time)
throw new Exception ("impossible situation, property get/set mismatch: [" + time + " vs " + filler.TimeStamp + "]: " + filler);
the second scenario succeeds and does not throw an exception:
var price = priorbar.Close;
var filler = new TrimmedBar (instrument, time, period, price, price, price, price, 0);
if (filler.TimeStamp != time)
throw new Exception ("impossible situation, property get/set mismatch: [" + time + " vs " + filler.TimeStamp + "]: " + filler);
The test is included. Can run the 1st code path with . run-fail and the second with . run-pass
Let me know if you need clarification.