JDK-8357822 : C2: Multiple string optimization tests are no longer testing string concatenation optimizations
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9,11,17,21,25,26
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-05-27
  • Updated: 2025-08-09
  • Resolved: 2025-06-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 26
26 b02Fixed
Related Reports
Relates :  
Description
Test7179138_2.java and other tests are no longer testing string concatenation optimizations since string concatenation no longer uses StringBuilders by default.

Test7179138_1.java has found three bugs, so these tests might be good to run with a configuration that uses StringBuilders for string concatenation. We could add a run with -XDstringConcat=inline to Test7179138_2.java and other affected tests.
Comments
[jdk25u-fix-request] Approval Request from Francesco Andreuzzi Applies cleanly. Adds tests for string concatenation optimization in C2. The tests are nice to have around since they've already spotted bugs in the past.
06-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk25u/pull/73 Date: 2025-08-06 16:21:38 +0000
06-08-2025

Changeset: 6c616c71 Branch: master Author: Daniel Skantz <dskantz@openjdk.org> Date: 2025-06-09 06:11:05 +0000 URL: https://git.openjdk.org/jdk/commit/6c616c71ec9a8ee6e0203921deef20d09db39698
09-06-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/25610 Date: 2025-06-03 07:17:47 +0000
03-06-2025

I found a few more tests.
02-06-2025

An ambitious solution or follow-up RFE is adding IR checks to stringopts tests.
27-05-2025

ILW = Test does not work anymore (but passes), single test, no workaround but you run -XDstringConcat=inline = MLM = P4
27-05-2025

https://github.com/openjdk/jdk/compare/master...danielogh:jdk:stringopts_4?expand=1
27-05-2025