Skip to content

8362171: C2 fails with unexpected node in SuperWord truncation: ModI #26334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/hotspot/share/opto/superword.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,7 @@ static bool can_subword_truncate(Node* in, const Type* type) {
switch (opc) {
case Op_AbsI:
case Op_DivI:
case Op_ModI:
case Op_MinI:
case Op_MaxI:
case Op_CMoveI:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

/*
* @test
* @bug 8350177
* @bug 8350177 8362171
* @summary Ensure that truncation of subword vectors produces correct results
* @library /test/lib /
* @run driver compiler.vectorization.TestSubwordTruncation
Expand Down Expand Up @@ -376,6 +376,18 @@ public void checkTestByteBitCount(Object[] vals) {
}
}

int intField;
short shortField;

@Test
@IR(counts = { IRNode.MOD_I, ">0" })
public void testMod() {
for (int i = 1; i < SIZE; i++) {
for (int j = 1; j < 204; j++) {
shortField %= intField | 1;
}
}
}

public static void main(String[] args) {
TestFramework.run();
Expand Down