diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index fff00343e888ab..dcf1fd4c619ad5 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -11198,13 +11198,14 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) temp = nullptr; } } - else if (op1->OperGet() == GT_ADD) + else { #ifdef TARGET_ARM + GenTree* effOp1 = op1->gtEffectiveVal(true); // Check for a misalignment floating point indirection. - if (varTypeIsFloating(typ)) + if (effOp1->OperIs(GT_ADD) && varTypeIsFloating(typ)) { - GenTree* addOp2 = op1->AsOp()->gtGetOp2(); + GenTree* addOp2 = effOp1->gtGetOp2(); if (addOp2->IsCnsIntOrI()) { ssize_t offset = addOp2->AsIntCon()->gtIconVal; diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_34170/Runtime_34170.cs b/src/tests/JIT/Regression/JitBlue/Runtime_34170/Runtime_34170.cs index 19fd90aff05ef6..622bbc1d04fd2a 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_34170/Runtime_34170.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_34170/Runtime_34170.cs @@ -21,7 +21,7 @@ public FloatNonAlignedFieldWithSmallOffset(float a) [StructLayout(LayoutKind.Explicit)] internal struct FloatNonAlignedFieldWithLargeOffset { - [FieldOffset(1021)] + [FieldOffset(0x10001)] public float field; public FloatNonAlignedFieldWithLargeOffset(float a) @@ -45,7 +45,7 @@ public DoubleNonAlignedFieldWithSmallOffset(float a) [StructLayout(LayoutKind.Explicit)] internal struct DoubleNonAlignedFieldWithLargeOffset { - [FieldOffset(1021)] + [FieldOffset(0x10001)] public double field; public DoubleNonAlignedFieldWithLargeOffset(float a)