Bug 15988 - Can't disable array bound checks
Summary: Can't disable array bound checks
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: 7.0.4.x
Hardware: PC Windows
: --- normal
Target Milestone: 7.0.6
Assignee: Bugzilla
Depends on:
Reported: 2013-11-07 07:13 UTC by Brad Robinson
Modified: 2013-12-12 12:02 UTC (History)
3 users (show)

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

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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Brad Robinson 2013-11-07 07:13:57 UTC
Not sure if this is a bug, not supported, or misunderstanding on my part.

I'm working on an app that will benefit from disabling array bounds checks (ie: -O=unsafe) but I can't find any documentation on how to pass this from XamStudio to the AOT compiler through mtouch.

I've tried setting "Additional mtouch arguments" to -O=unsafe also --optimize=unsafe also --optimize=abcrem and other variations but always get an error like:

AOT : Unknown argument '--optimize=unsafe'

even though arm-darwin-mono-boehm reports this as an optimization option when run with --list-opts

Is this supported?

See also: http://forums.xamarin.com/discussion/9872/how-to-disable-runtime-array-bounds-checks
Comment 1 Rolf Bjarne Kvinge [MSFT] 2013-11-08 13:19:57 UTC
Can you try using this as the additional mtouch arguments and see what happens?:

Comment 2 Brad Robinson 2013-11-09 23:19:46 UTC
Thanks for looking into this.

I tried --aot-options=--optimize=abcrem and while it compiled without error, the disassembly in Instruments was unchanged, and still looked like it had bounds checking and exception throwing code. (both with and without llvm compiler enabled).

However, --aot-options=--optimize=unsafe seems to work.
Comment 3 PJ 2013-12-11 18:45:50 UTC
This fix is planned to be released with Xamarin.iOS 7.0.6, which should hit the beta channel before December 23rd.
Comment 4 Mohit Kheterpal 2013-12-12 12:02:07 UTC
As per comment 2, we are not getting this issue any more.

We are able to run application having mtouch arguments "--aot-options=--optimize=unsafe" & with both llvm enable and disabled.

Hence closing this issue.

Please let us know if we have to check something else.