Fix arm32 local variable references
authorBruce Forstall <Bruce_Forstall@msn.com>
Thu, 6 Dec 2018 07:48:11 +0000 (23:48 -0800)
committerBruce Forstall <Bruce_Forstall@msn.com>
Thu, 6 Dec 2018 07:48:11 +0000 (23:48 -0800)
commitc153d9fc6627e5bb35e31eea6038f64f2a006022
tree1cd3d5b8d10af4d71c7766e0e4c4d7cf7ff9ec5a
parent8aa0869eb9153429091fdba49469d89ec33092cb
Fix arm32 local variable references

Arm32 has different addressing mode offset ranges for floating-point
and integer instructions. In addition, the ranges aren't too large.
So in functions with a frame pointer, we try to access some variables
using the frame pointer and some with the stack pointer, to expand the
total number of variables we can access without allocating a "reserved
register" just used for constructing large offsets.

This calculation was incorrect for struct variables that contained floats,
as float fields require calculating using the floating point range, but we
were calculating using the variable type (struct), instead of the instruction
type (floating-point). In addition, we were not correctly calculating the
frame pointer range using the actual variable offset plus "within variable"
offset (struct member offset).

Added a test that covers some of these cases.

Fixes #19537
12 files changed:
src/jit/compiler.cpp
src/jit/compiler.h
src/jit/compiler.hpp
src/jit/emit.cpp
src/jit/emitarm.cpp
src/jit/emitarm.h
src/jit/lclvars.cpp
tests/arm/corefx_linux_test_exclusions.txt
tests/arm/corefx_test_exclusions.txt
tests/issues.targets
tests/src/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.cs [new file with mode: 0644]
tests/src/JIT/Regression/JitBlue/GitHub_19537/GitHub_19537.csproj [new file with mode: 0644]