summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression
AgeCommit message (Collapse)AuthorFilesLines
2020-03-25[Tizen] Fix build of Runtime_1241 testsubmit/tizen/20200402.013218accepted/tizen/unified/20200402.155517Gleb Balykov1-3/+23
2020-03-25Fail to explicitly tail call on x86 unix. (#25032)Jarret Shook2-0/+49
* Fail to explicitly tail call on x86 unix. * Correctly return 100 * Correct return value * Add noway assert in morphTailCall to avoid morphing slow tail calls on unix. * Address feedback
2020-02-13Port of dotnet/runtime#1059 to 3.1 branch (#27986)Carol Eidt2-0/+99
This is the fix for #27924. This is a GC hole bug that was found externally, #27590. The cause is that the JIT was using the target type of the subtract when it needed to make a copy of the source, but it needs to use the source type. ## Customer Impact Corruption of state that is non-deterministic and hard to track down. ## Regression? Not a recent regression, but exposed by Unsafe.ByteOffset. ## Testing The fix has been verified in the runtime repo. ## Risk Low: The fix is straightfoward and only impacts 3 lines of code.
2020-02-13Port fix for #1241 to 3.1 (#27983)Carol Eidt2-0/+108
2020-02-13Port the 5.0 fix for issue #1104 (#28003)Brian Sullivan2-0/+95
* Port the 5.0 fix for issue #1104 3.1 - Pull Request Runtime\#1734 - This change corrects a cut-and paste typo with a previous commit. - Includes test case Runtime_1104.cs * Updated the csproj to use 3.1 syntax
2020-01-14[release/3.1] Port fix for JIT silent bad code (#27972)Andy Ayers2-0/+85
* [release/3.1] Port fix for JIT silent bad code Release/3.1 port of https://github.com/dotnet/runtime/pull/797. Fixes https://github.com/dotnet/runtime/issues/764 The jit might incorrectly order a read from a struct field with an operation that modifies the field, so that the read returns the wrong value. Silent bad code; program behaves incorrectly. Yes, introduced in the 3.0 cycle. Verified the user's test case now passes; no diffs seen in any existing framework or test code. **Low**: the jit is now spilling the eval stack entries to temps in cases where it did not before; this should be conservatively safe. cc: @brucefo ____ If we're appending an assignment whose LHS is is a location within a local struct, we need to spill all references to that struct from the eval stack. Update the existing logic for this to handle the case where the LHS is a field of a local struct, and the field is updated by unusual means (here, `initobj`). Fixes dotnet/runtime#764. * Fix test
2020-01-14Release/3.1 port of dotnet/runtime#239 (#27973)Andy Ayers2-0/+68
Fix for #27923 The jit might fail to locate a class handle for a ref class, leading to an unexpected crash while jitting. ## Customer Impact Unexpected and hard to diagnose crash/exception ## Regression? Yes, introduced during the development 3.0 cycle. 2.x behaves correctly. ## Testing Verified the user's test case now passes; no diffs seen in any existing framework or test code. ## Risk **Low**: the jit will now fall back to using the handle for System.Object if no better option can be found. cc @BruceForstall ____ In some cases we may end up in lvaSetClass without a valid ref class handle from either the IR or the stack. Use the handle for object as a conservative fallback.
2019-07-01Get rid of warnings while building tests (#25514)Michal Strehovský1-0/+1
2019-06-20Added the complementary test cases of going from a negative int to an unsigned.Brian Sullivan1-8/+77
2019-06-19Fix Issue #25134 - AssertionProp incorrectly removes cast from uintBrian Sullivan2-0/+123
Add additional check for the GT_UNSIGNED flag + Ran clang-format + Code review feedback, use IsUnsigned()
2019-06-18Fix contained LEA handling (#25135)Carol Eidt2-0/+98
* Fix contained LEA handling This adds an LEA case to both `LinearScan::BuildOperandUses` and `CodeGen::genConsumeRegs`. Fix #25039
2019-06-14Don't change LCL_FLD node type when replacing param with its shadow copy ↵Egor Chesakov2-0/+550
(#20900) Fix an issue that is reproduced when: 1) a method requires GSSecurityCookie (e.g. when allocating unsafe buffer using localloc) and 2) one of the method parameters is "vulnerable" and requires a shadow variable to be created and used instead of the original parameter variable and 3) the method parameter has small signed integer type (i.e. int8 or int16) and 4) the value of the parameter is converted to unsigned type (e.g. uint8 or uint16).
2019-06-14Delete OSX condition.Sergey Andreenko1-2/+1
2019-06-14Do not force GCStress at all.Sergey Andreenko1-2/+0
It doesn't work on OSX and Alpine. It shows random failures on Windows as well, that we do not want to see in our PR/CI outerloop testing.
2019-06-13Do not force GcStress=0xc for GitHub_23199.Sergey Andreenko1-3/+4
There was a typo for Unix (it is COMPlus_GCStress, not COMPlus_GcStress, but COMPlus_GcStressOnDirectCalls was correct). That was why the test passed on OSX.
2019-06-11JIT: use stress mode tail call validation info for implicit tail calls (#25093)Andy Ayers2-0/+126
If a call site fails tail call stress validation, don't consider it for implicit tail calling either. In normal jitting we defer this level of validation until impImportCall to avoid duplicating work. This avoids an assert when we have invalid IL. Fixes #25027.
2019-06-05Fix GCStress coverage for multi reg returns. (#24826)Sergey Andreenko2-0/+250
* Extract ReplaceInstrAfterCall. * Avoid GCStress when return multireg with pointers. Determinate when we need to protect the second register and do not cause GCStress in such cases. * Add a repro test. * Reenable MethodImplOptionsTests. * Extract IsGcCoveregeInterruptInstruction. That changes how we do checks for arm32 in `IsGcCoverageInterrupt`. * Tolerate direct call to JIT_RareDisableHelper. x86 ILStubClass:IL_STUB_PInvoke(byref,ref,int,byref):int generates it like: Generating: N119 ( 4, 7) [000118] ------------ * RETURNTRAP int REG NA IN0021: cmp dword ptr [0F9BF9F8H], 0 New Basic Block BB10 [0009] created. IN0022: je L_M6496_BB10 Call: GCvars=00000001 {V01}, gcrefRegs=00000000 {}, byrefRegs=00000000 {} IN0023: call CORINFO_HELP_STOP_FOR_GC * Support GC stress protect return 1/2/both Unix x64. * Fix arm64. Do not insert GC Stress instrucitons when we can't determinate the exact return kind. * Fix review1. * Fix review2. * Change the test as Andy suggested. * Fix some typos. * Replace all SLOT with PBYTE. * Disable assert that can fail because of multithreading.
2019-06-05Zero initReg in genSetGSSecurityCookie (#24371)Egor Chesakov2-0/+91
Fix an issue that is reproduced when 1) a register is used in the prolog for initializing GSSecurityCookie (i.e. the register contains a random non-zero value) and 2) the same register holds a must-init GC variable in the next basic block and 3) the variable is live at the beginning of this basic block. The register was not zeroed at the end of the prolog and this was causing segmentation fault during GC.Collect().
2019-06-05Cleanup block stores and test for 24846 (#24950)Carol Eidt1-49/+39
* Cleanup block stores and test for 24846 Fix zero-length assert/bad codegen for initblk. Remove redundant assertions in codegen and those that don't directly relate to codegen requirements. Eliminate redundant LEA that was being generated by `genCodeForCpBlk`. Rename `genCodeFor[Cp|Init]Blk` to `genCodeFor[Cp|Init]BlkHelper` to parallel the other forms. Fix the test case for #24846.
2019-05-31Handle a zero byte cpblk (#24871)Carol Eidt2-0/+88
Fix #24846
2019-05-22Test case for #24657 (#24721)Carol Eidt2-0/+71
This bug is a duplicate of #18522. Adding the additional repro. Close #24657
2019-05-09Mark local struct as having overlapping fields after struct reinterpretationEugene Rozenfeld2-0/+78
Methods like System.Runtime.CompilerServices.Unsafe.As<TFrom, TTo> may have struct reinterpretation when function signature specifies Struct1& and the method returns Struct2& where Struct1 and Struct2 are different structs. This may confuse jit optimizations (in particular, value numbering) because fields of a struct of type Struct1 may be accessed using handles of Struct2. This fix marks the source local involved in such struct reinterpretation as having overlapping fields. That prevents SSA builder from inserting the local into SSA. Fixes #24159. No diffs in framework assemblies and coreclr benchmarks.
2019-05-06Handle E_NOTIMPL return from CoInitializeEx. (#24387)Jeremy Koritzinsky3-3/+0
* Handle E_NOTIMPL return from CoInitializeEx. * Remove unneeded STA attributes.
2019-05-04Revert "Fix GCStress for multireg returns. "Sergey Andreenko2-83/+0
2019-05-02Add a repro test.Sergey Andreenko2-0/+83
2019-04-29Merge pull request #24282 from erozenfeld/Fix24253Eugene Rozenfeld2-0/+90
Fix for a jit liveness bug.
2019-04-26Fix for a jit liveness bug.Eugene Rozenfeld2-0/+90
`fgRemoveDeadStore` has special logic for removing dead assignments whose rhs was of type `TYP_STRUCT`: https://github.com/dotnet/coreclr/blob/311b5e2fe413c6c74a2a3680ab54d8a978651472/src/jit/liveness.cpp#L2264-L2274 That logic was applied to "normal" assignments (i.e., direct children of `GT_STMT`) but not to "internal" assignments (e.g., children of `GT_COMMA`). The test case has an internal assignment and, because this logic wasn't applied, we ended up with a standalone `GT_IND` of type `TYP_STRUCT` that the register allocator can't handle. This change apples the missing logic to "internal" assignments. Fixes #24253.
2019-04-25Add a repro test.Sergey Andreenko2-0/+69
2019-04-22Fix Arm64 UpperVector save/restore (#24043)Carol Eidt2-0/+138
* Fix Arm64 UpperVector save/restore Change the general handling of end-of-block restores so that we always have a RefPosition on which to allocate the register needed on Arm64. Fix #23885
2019-04-19Add a repro test.Sergey Andreenko2-0/+67
2019-04-17JIT: ignore pinning of non-gc types (#24010)Andy Ayers3-0/+78
We may see pin modifiers on locals that are not gc types. Ignore these modifiers. Closes #23950. Also added a missing copyright header on an unrelated test.
2019-04-17Restrict morph add rearrangement. (#23984)Eugene Rozenfeld2-0/+200
Morph has transformations ((x + const) + y) => ((x + y) + const) and ((x + const1) + (y + const2)) => ((x + y) + (const1 + const2)) If x or y is a GC pointer and one of the int operands may be negative, this may result in a byref temp that points outside of the ref object. If the code is in a non-interruptible region and a GC happens, the byref won't be updated. This change disallows the transformations if one of the non-const operands is a GC pointer. Fixes #23792.
2019-04-17Update the types consumers of Index and Range (#24036)Tarek Mahmoud Sayed2-78/+0
* Update the types consumers of Index and Range The C# compiler now can automatically support the indexers with Index and Range parameters on any type meet the conditions: - The type exposes Length or Count property which returning integer. - The type has indexer of integer parameter. - The type has a Slice method which takes 2 integers The change here is to remove the methods and indexers of the types which we previously added it as the compiler will automatically provide those. * Remove the JIT failing test
2019-04-13Fix ARM's genPutArgStk codegen (#23867)mikedn2-0/+75
* Fix ARM's genPutArgStk codegen When the OBJ node wraps a LCL_VAR node the code uses the type information (struct size, GC layout) from LclVarDsc. This is not always correct because the OBJ may actually have a different struct type due to type reinterpretation (e.g. Unsafe.As<X, Y>). * Fix genPutArgStk comment
2019-04-12Don't Free UpperVector (#23889)Carol Eidt2-0/+103
* Don't Free UpperVector UpperVector regs are freed at their time of use, and shouldn't be freed when the last RefPosition is encountered. Also, we need to specify all 3 operands for vinsertf128 Fix #23861 Fix #23904 Fix #23804
2019-04-12JIT: update byref null check logic to handle field chains (#23850)Andy Ayers2-0/+75
The jit was not properly accumulating offsets when figuring out if a byref should be null checked. Use a non-null MorphAddressContext as indication that GT_FIELD and GT_IND nodes are actually part of an ongoing address computation. During field morphing propagate the current address context to the child node, instead of starting a new one. Fixes #23791.
2019-04-08Block the hoisting of TYP_STRUCT rvalues in loop hoistingBrian Sullivan2-0/+230
Added test case GitHub_23739.cs
2019-04-04Improve Upper Vector Save/Restore (#23344)Carol Eidt2-0/+132
Improve Upper Vector Save/Restore In order to avoid saving and restore the upper half of large vectors around every call even if they are not used, separately model the upper half of large vector lclVars, and track whether the large vector lclVar is partially-spilled, in which case its upper half resides in its upper half Interval's location. Fix #18144
2019-04-02Fix spill check for struct lclVars (#23570)Carol Eidt2-0/+67
* Fix spill check for struct lclVars With the 1st class struct changes, the `SPILL_APPEND` check for the case of an assignment to a lclVar needs to handle block ops as well as lclVar lhs. Fix #23545
2019-03-29Fix HW intrinsic containment bugs (#23558)Carol Eidt2-0/+68
* Fix HW intrinsic containment bugs For the Fma case (#23430), fix the handling of contained 3-operand HW intrinsic nodes. For the Bmi case (#23534), fix a bad assert placement, and re-enable the Bmi tests. Fix #23530 Fix #23534 * Add guard for Fma test
2019-03-28Fix for issue #23441Brian Sullivan2-0/+244
Added test case GitHub_23411
2019-03-28Struct & SIMD improvements (#22255)Carol Eidt6-0/+280
* [WIP] Struct & SIMD improvements - Enable CSE of struct values when handle is available (and add code to get the handle of HW SIMD types) - Don't require block nodes for SIMD assignments - Don't set `GTF_GLOB_REF` on `GT_OBJ` if it is local - Set `lvRegStruct` on promoted SIMD fields - Add tests for #19910 (fixed with this PR) and #3539 & #19438 (fixed with #21314) - Additional cleanup Fix #19910
2019-03-26Handle addressing modes for HW intrinsics (#22944)Carol Eidt2-0/+159
* Handle addressing modes for HW intrinsics Also, eliminate some places where the code size estimates were over-estimating. Contribute to #19550 Fix #19521
2019-03-25Mark test GitHub_18582 as optimization sensitive (#23434)Andy Ayers1-0/+1
Jitstress on OSX will turn on cloning stress in `Test` and cause stack overflows cloning the large `GT_LIST` subtree of the call. See issue #23346.
2019-03-20Add repro case for jit stack overflow failure (#23346)Andy Ayers2-0/+260
Repro case for #18582 and #23309.
2019-03-13Merge pull request #23109 from briansull/gh-21231Brian Sullivan4-0/+147
Fix for Issue 21231
2019-03-13Merge pull request #23220 from BruceForstall/FixArm64HfaJmpCallNyiBruce Forstall3-0/+1063
Arm64: Implement JMP call for HFA register arguments
2019-03-13Fix for Issue 21231Brian Sullivan4-0/+147
When transferring a Zero offset from one GenTree node to another, we need to check if there already is a FieldSeq and append to it. Added third parameter 'kind' to JitHashTable::Set, and Added enum SetKind Only allow Set to overwrite an existing entry when kind is set to Overwrite. Added validation for all calls to JitHashTable::Set asserting that we don't expect the key to already exist or that we passed Overwrite indicating that we expect to handle it properly. Added two test cases for Issue 21231
2019-03-13Fix SIMD handle issues (#23193)Carol Eidt2-0/+184
* Fix SIMD handle issues PR #23052 was overly aggressive at applying the provided class handle (which defaults to NO_CLASS_HANDLE). In addition, make a small change to `SIMDIntrinsicWiden`, as it doesn't need to go through the complexity of inferring a class handle when it already exists on the node it's duplicating. Fix #23159
2019-03-12Arm64: Implement JMP call for HFA register argumentsBruce Forstall3-0/+1063
Add the code to load up HFA register arguments into their correct registers before a JMP call. Removes remaining NYI. Fixes #23147 Add a test case with several variants of HFA and JMP call.