File tree Expand file tree Collapse file tree 3 files changed +45
-1
lines changed
tests/JIT/Regression/JitBlue/Runtime_91855 Expand file tree Collapse file tree 3 files changed +45
-1
lines changed Original file line number Diff line number Diff line change @@ -11028,7 +11028,16 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
1102811028 }
1102911029 }
1103011030
11031- if (lhs == nullptr || rhs == nullptr)
11031+ if ((lhs == nullptr) || (rhs == nullptr))
11032+ {
11033+ break;
11034+ }
11035+
11036+ // Filter out side effecting cases for several reasons:
11037+ // 1. gtNewSimdBinOpNode may swap operand order.
11038+ // 2. The code above will swap operand order.
11039+ // 3. The code above does not handle GTF_REVERSE_OPS.
11040+ if (((lhs->gtFlags | rhs->gtFlags) & GTF_ALL_EFFECT) != 0)
1103211041 {
1103311042 break;
1103411043 }
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.aa
3+
4+ using System ;
5+ using System . Runtime . CompilerServices ;
6+ using System . Runtime . Intrinsics ;
7+ using Xunit ;
8+
9+ public class Runitme_91855
10+ {
11+ [ Fact ]
12+ public static void TestEntryPoint ( )
13+ {
14+ Assert . Throws < DivideByZeroException > ( ( ) => Foo ( null , 0 ) ) ;
15+ }
16+
17+ [ MethodImpl ( MethodImplOptions . NoInlining ) ]
18+ private static Vector128 < uint > Foo ( C c , uint val )
19+ {
20+ return Vector128 . Create < uint > ( 100u / val ) & ( c . V ^ Vector128 < uint > . AllBitsSet ) ;
21+ }
22+
23+ private class C
24+ {
25+ public Vector128 < uint > V ;
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ <Project Sdk =" Microsoft.NET.Sdk" >
2+ <PropertyGroup >
3+ <Optimize >True</Optimize >
4+ </PropertyGroup >
5+ <ItemGroup >
6+ <Compile Include =" $(MSBuildProjectName).cs" />
7+ </ItemGroup >
8+ </Project >
You can’t perform that action at this time.
0 commit comments