Skip to content

Commit 70c1ff7

Browse files
committed
8362171: C2 fails with unexpected node in SuperWord truncation: ModI
Reviewed-by: thartmann, chagedorn
1 parent 6ed8164 commit 70c1ff7

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/hotspot/share/opto/superword.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,7 @@ static bool can_subword_truncate(Node* in, const Type* type) {
25812581
switch (opc) {
25822582
case Op_AbsI:
25832583
case Op_DivI:
2584+
case Op_ModI:
25842585
case Op_MinI:
25852586
case Op_MaxI:
25862587
case Op_CMoveI:

test/hotspot/jtreg/compiler/vectorization/TestSubwordTruncation.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
/*
3131
* @test
32-
* @bug 8350177
32+
* @bug 8350177 8362171
3333
* @summary Ensure that truncation of subword vectors produces correct results
3434
* @library /test/lib /
3535
* @run driver compiler.vectorization.TestSubwordTruncation
@@ -376,6 +376,18 @@ public void checkTestByteBitCount(Object[] vals) {
376376
}
377377
}
378378

379+
int intField;
380+
short shortField;
381+
382+
@Test
383+
@IR(counts = { IRNode.MOD_I, ">0" })
384+
public void testMod() {
385+
for (int i = 1; i < SIZE; i++) {
386+
for (int j = 1; j < 204; j++) {
387+
shortField %= intField | 1;
388+
}
389+
}
390+
}
379391

380392
public static void main(String[] args) {
381393
TestFramework.run();

0 commit comments

Comments
 (0)