Android/ARM codegen

Dan Olson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Jul 16 09:40:31 PDT 2015


"Joakim" <dlang at joakim.fea.st> writes:
>
> The problem appears to be that even though r4 is saved at the
> beginning of the function, it is overwritten by r1 in the stmib
> instruction afterwards.  Obviously there's no point in pushing r4 and
> popping it at the end of the function, if you've lost it by
> overwriting in between.  Specifically, "sub sp, sp, #8" advances the
> stack pointer by 8, then stmib increments it 4 _before_ storing r0
> then r1, overwriting the contents of r4 saved at the beginning of the
> function.  Other calls to map also seem to fail in other instances of
> the same template function, but interestingly in different ways, ie no
> uses of stmib there.  I haven't tracked down exactly why those other
> instances fail.

That doesn't look right.

What is your triple and other options (optimization), llvm version your
patched src is based on, and ldc branch (merge-2.067 branch I think)?
I'd like to compare the asm snippet with what I get get for
thumbv7-apple-ios, because it should be similar, but it passes std.zip.

It could be I just haven't stumbled into the combination you are using.

-- 
Dan



More information about the digitalmars-d-ldc mailing list