Bug 52735 - Mono too aggressively optimized code. Skip convert
Summary: Mono too aggressively optimized code. Skip convert
Status: NEW
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: 4.8.0 (C9)
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-02-24 10:51 UTC by Sergei
Modified: 2017-03-02 00:47 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

generated il code (2.82 KB, text/plain)
2017-02-24 10:51 UTC, Sergei

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 52735 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Sergei 2017-02-24 10:51:03 UTC
Created attachment 19941 [details]
generated il code

Part of il(emit) generated code attached.
The defect appears only in release mode(if start .exe with '--debug=mdb-optimizations', app will be work correctly).
this code throw exception with message: " Error feeding module: Field "xxx.TradeMessage.aggressorSide", bound to xxx.Messages.AggressorSide (underliing type is System.Int32), cannot contain unsupported value 255 of enum xxx.Messages.AggressorSide. This value is out of supported range."

can see(from attached il src) exception mean that 'AggressorSide_6' local variable has '255' value. but 'AggressorSide_6' local variable was assigned with SByte value[-128;127].

method ReadEnumInt8() from which was taken SByte can be represented as (with simplifications):

SByte ReadEnumInt8()
   return (SByte)byteArray[i]; //where byteArray is byte[]

It looks like mono skip Byte to SByte convertion.