Runtime for ARM

Kai Nacke kai at redstar.de
Tue May 14 20:30:11 PDT 2013


On Saturday, 16 February 2013 at 23:45:55 UTC, Paolo Invernizzi 
wrote:
> Right now I've reduced the ice to something like:
>
> template Rebindable(T) {
>     struct Rebindable {
>         void opAssign(Rebindable ) {}
>     }
> }
> struct SysTime {
>     Rebindable!(TimeZone) _timezone;
> }
> class TimeZone {}
>
> ice with ldc2 -c ice.d -march=arm -mcpu=cortex-a9 
> -mtriple=arm-linux-gnueabihf

Hi Paolo!

It is a LLVM bug. I used bugpoint and a bit of editing to derive 
this IR file:

; ModuleID = 'bugpoint-reduced-simplified.bc'
target datalayout = 
"e-p:32:32:32-S64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f16:16:16-f32:32:32-f64:64:64-f128:128:128-v64:64:64-v128:64:128-a0:0:64-n32"
target triple = "arm--linux-gnueabihf"

%"armbug.Rebindable!(TimeZone).Rebindable" = type <{ i8 }>
%armbug.SysTime = type <{ 
%"armbug.Rebindable!(TimeZone).Rebindable" }>
%armbug.TimeZone = type { i8* }

declare fastcc void 
@opAssign(%"armbug.Rebindable!(TimeZone).Rebindable"*, 
%"armbug.Rebindable!(TimeZone).Rebindable"* byval)

define fastcc %armbug.SysTime* @doOpAssign(%armbug.SysTime* 
%.this_arg, %armbug.SysTime* byval %p_arg) {
entry:
   br i1 undef, label %noassert, label %assert

assert:                                           ; preds = %entry
   unreachable

noassert:                                         ; preds = %entry
   call fastcc void 
@opAssign(%"armbug.Rebindable!(TimeZone).Rebindable"* undef, 
%"armbug.Rebindable!(TimeZone).Rebindable"* byval undef)
   ret %armbug.SysTime* %.this_arg
}

You get the assertion failure if you use llc to compile this 
file. This does not happen on X86_64 - it is a bug!

Please, could you file a bug report for LLVM: 
http://llvm.org/bugs/

BTW: This is quite natural. LDC uses LLVM in some other way then 
clang. This may raise otherwise unnoticed bugs. For PPC64, I 
currently work on the 3rd LLVM bug...

Regards
Kai


More information about the digitalmars-d-ldc mailing list