https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87289
Bug ID: 87289 Summary: jdk11 plinux compiled with gcc 7.3 doesn't work with NativeImageBuffer Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pdbain at ca dot ibm.com Target Milestone: --- Created attachment 44683 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=44683&action=edit Test code and sample source code Further to https://github.com/eclipse/openj9/issues/2788 GCC does not compile "jnicsup.cpp" correctly when optimization is enabled. It appears that "pushArguments()" is not placing the correct data on the Java stack. Inserting a printf makes the test pass. To reproduce: download and build OpenJ9 per instructions in https://www.eclipse.org/openj9/oj9_build.html (use "git clone https://github.com/ibmruntimes/openj9-openjdk-jdk11"). Replace "openj9/runtime/vm/jnicsup.cpp" with the copy from the attached archive. Enable or disable the printf on line 522. To test, put "testgras.class" in the current directory and run "java testgras" (the "java" command will be in a directory called "build/linux-ppc64le-normal-server-release/images/jdk/bin") If the test is successful, no exception is thrown. This bug may date back to version 5.