Bug 14217 - Assertion: should not be reached at ../../../../../mono/mono/mini/mini-llvm.c:949
Summary: Assertion: should not be reached at ../../../../../mono/mono/mini/mini-llvm.c...
Alias: None
Product: iOS
Classification: Xamarin
Component: General ()
Version: 4.x
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2013-08-23 17:40 UTC by kissling
Modified: 2015-08-17 13:10 UTC (History)
5 users (show)

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

Sample project where the described issue occurs. (4.42 KB, application/zip)
2013-08-23 17:40 UTC, kissling

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 kissling 2013-08-23 17:40:00 UTC
Created attachment 4704 [details]
Sample project where the described issue occurs.

I ran into strange issues when compiling a method with a sophisticated struct as argument with LLVM optimizations enabled.

    public enum ByteEnum : byte
        Zero = 0

    public struct BugStruct
        public ByteEnum f1;
        public ByteEnum f2;
        public ByteEnum f3;
        public byte f4;
        public byte f5;
        public byte f6;
        public byte f7;

    public sealed class Bug
        public void DoesntCompileWithLLVM(BugStruct bug)

The method in the class Bug does not compile.

Note that any of the following changes lets the compilation succeed:
- Change the type of the enum from byte to something different.
- Remove the method DoesntCompileWithLLVM(BugStruct).
- Remove an element from the struct.
- Add an element to the struct.
- Allocate the struct as a local variable within the method instead of passing it as an argument.
- Change the type of one of the byte fields to something different.
- Change the struct to a class.

Sample project is attached.
- Choose RELEASE on a PHYSICAL DEVICE (not simulator).
- Try to compile.

The build output is the following:


Compiling to native code
/Developer/MonoTouch/usr/bin/mtouch -sdkroot "/Applications/Xcode5-DP5.app/Contents/Developer" --cache "/Users/***/LLVM/Bug/obj/iPhone/Release/mtouch-cache" --nomanifest --nosign -dev "/Users/***/LLVM/Bug/bin/iPhone/Release/Bug.app" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/System.Core.dll" -r "/Developer/MonoTouch/usr/lib/mono/2.1/monotouch.dll" -linksdkonly -sdk "7.0" -targetver "6.0" --abi=armv7+llvm,armv7s+llvm "/Users/***/LLVM/Bug/bin/iPhone/Release/Bug.exe"
MonoTouch Business version 6.9.6 using framework: /Applications/Xcode5-DP5.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk
AOT Compilation exited with code 134, command:
MONO_PATH=/Users/***/LLVM/Bug/obj/iPhone/Release/mtouch-cache/Build /Developer/MonoTouch/usr/bin/arm-darwin-mono-boehm --debug --llvm -O=gsharedvt  --aot=mtriple=armv7s-ios,full,static,asmonly,direct-icalls,nodebug,dwarfdebug,llvm-path=/Developer/MonoTouch/LLVM/bin/,outfile="/Users/***/LLVM/Bug/obj/iPhone/Release/mtouch-cache/Bug.exe.armv7s.s" "/Users/***/LLVM/Bug/obj/iPhone/Release/mtouch-cache/Build/Bug.exe"
Mono Ahead of Time compiler - compiling assembly /Users/***/LLVM/Bug/obj/iPhone/Release/mtouch-cache/Build/Bug.exe
i32 %0
i24 0
* Assertion: should not be reached at ../../../../../mono/mono/mini/mini-llvm.c:949


Version information:

=== Xamarin Studio ===

Version 4.1.9 (build 6)
Installation UUID: 938751df-f7a5-457d-b87b-379763e0ada1
	Mono 3.2.2 ((no/a0fc6ba)
	GTK+ 2.24.20 theme: Raleigh
	GTK# (
	Package version: 302020000

=== Apple Developer Tools ===

Xcode 5.0 (3329.43)
Build 5A11365x

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: d46e8f2
Build date: 2013-19-08 09:52:00-0400

=== Xamarin.Android ===

Version: 4.8.2 (Business Edition)
Android SDK: /Users/***/Library/Developer/Xamarin/android-sdk-mac_x86
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
Java SDK: /usr
java version "1.6.0_51"
Java(TM) SE Runtime Environment (build 1.6.0_51-b11-457-11M4509)
Java HotSpot(TM) 64-Bit Server VM (build 20.51-b01-457, mixed mode)

=== Xamarin.Mac ===

Xamarin.Mac: Not Installed

=== Build Information ===

Release ID: 401090006
Git revision: 123fc693ab9ba2690f93fcfe2cd3499335049ff4
Build date: 2013-08-06 15:11:38+0000
Xamarin addins: ad4a498b75333e43547e87574c1ec8c7cae05de0

=== Operating System ===

Mac OS X 10.8.4
Darwin ***.local 12.4.0 Darwin Kernel Version 12.4.0
    Wed May  1 17:57:12 PDT 2013
    root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64
Comment 1 Zoltan Varga 2013-08-29 18:50:45 UTC
Fixed in mono master 82128fa5030312dfe824c0c333e2a1a6bfbe76b5.
Comment 2 Marek Safar 2015-08-17 13:10:51 UTC
Closing status