-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
24.0.2
-
x86_64
-
windows
ADDITIONAL SYSTEM INFORMATION :
Windows 11 (can't select above)
Affects OpenJDK 24 and 25
A DESCRIPTION OF THE PROBLEM :
I believe it's caused by this change:
JDK-8320448
I found a bug issue:
JDK-8360271
I'd like to add a simple Java reproducer for the problem.
My workaround is to disable 'EnableX86ECoreOpts'
REGRESSION : Last worked in version 23
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run the JUnit test below
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
As the test expects: 9
ACTUAL -
Actual is -1 if the intrinsic was used (I assume)
---------- BEGIN SOURCE ----------
public class ReproStringBugTest {
@BeforeClass // if this line is commented out, the tests are good
public static void warmup() {
for (int i = 0; i < 10_000; i++) { // could also just specify -Xcomp VM option but thats much much slower
"Sher\ufffflockSherlock".indexOf("Sherlock");
"Sher\ufffflockSherlock".indexOf("Sherlock", 0);
}
}
@Test
public void repro1() {
// any char above 0xff seems to trigger this error
Assert.assertEquals(9, "Sher\ufffflockSherlock".indexOf("Sherlock"));
}
@Test
public void repro2() {
Assert.assertEquals(9, "Sher\ufffflockSherlock".indexOf("Sherlock", 0));
}
}
---------- END SOURCE ----------
Windows 11 (can't select above)
Affects OpenJDK 24 and 25
A DESCRIPTION OF THE PROBLEM :
I believe it's caused by this change:
I found a bug issue:
JDK-8360271
I'd like to add a simple Java reproducer for the problem.
My workaround is to disable 'EnableX86ECoreOpts'
REGRESSION : Last worked in version 23
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Please run the JUnit test below
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
As the test expects: 9
ACTUAL -
Actual is -1 if the intrinsic was used (I assume)
---------- BEGIN SOURCE ----------
public class ReproStringBugTest {
@BeforeClass // if this line is commented out, the tests are good
public static void warmup() {
for (int i = 0; i < 10_000; i++) { // could also just specify -Xcomp VM option but thats much much slower
"Sher\ufffflockSherlock".indexOf("Sherlock");
"Sher\ufffflockSherlock".indexOf("Sherlock", 0);
}
}
@Test
public void repro1() {
// any char above 0xff seems to trigger this error
Assert.assertEquals(9, "Sher\ufffflockSherlock".indexOf("Sherlock"));
}
@Test
public void repro2() {
Assert.assertEquals(9, "Sher\ufffflockSherlock".indexOf("Sherlock", 0));
}
}
---------- END SOURCE ----------
- duplicates
-
JDK-8360271 String.indexOf intrinsics fail with +EnableX86ECoreOpts and -CompactStrings
-
- Open
-