RFR(S): 8243670: Unexpected test result caused by C2 MergeMemNode::Ideal

Yangfei (Felix) felix.yang at huawei.com
Wed Jun 17 12:32:57 UTC 2020


Hi Tobias,

> -----Original Message-----
> From: Tobias Hartmann [mailto:tobias.hartmann at oracle.com]
> Sent: Wednesday, June 17, 2020 4:09 PM
> To: Yangfei (Felix) <felix.yang at huawei.com>; Nils Eliasson
> <nils.eliasson at oracle.com>; hotspot-compiler-dev at openjdk.java.net
> Subject: Re: RFR(S): 8243670: Unexpected test result caused by C2
> MergeMemNode::Ideal
> 
> Hi Felix,
> 
> On 15.06.20 11:13, Yangfei (Felix) wrote:
> > I see the logic is also triggered for non-OSR compiles with the reduced test
> case.
> > But it didn't trigger a bug in that case even through the logic didn't do the
> right thing.
> >
> > My initial patch removes the logic and no performance impact witnessed
> for specjbb2017.
> > Since the code is there from day one, maybe it's hard to find out.
> 
> Even if the change introduces a regression (for example, blocking some loop
> optimization due to useless memory merges not being removed), I think it's
> unlikely to show in SPECjbb.

OK, that make sense to me.

> To get a sense of how often this code is triggered, you could simply add an
> assert or log code and run the jtreg compiler tests.

When I try something like:
diff -r 10d1e833ba25 src/hotspot/share/opto/memnode.cpp
--- a/src/hotspot/share/opto/memnode.cpp        Wed Jun 17 05:28:05 2020 +0200
+++ b/src/hotspot/share/opto/memnode.cpp        Wed Jun 17 19:53:44 2020 +0800
@@ -4619,6 +4619,7 @@
         if (phi_mem != NULL) {
           // equivalent phi nodes; revert to the def
           new_mem = new_base;
+          assert(false, "just checking");
         }
       }
     }

Then I even fail to do a slowdebug build with this.   So I suppose this is not something rarely executed.  

Build log:
......
Creating interim java.base.jmod
Creating interim jimage
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/memnode.cpp:4622
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (/home/yangfei/openjdk-jdk/src/hotspot/share/opto/memnode.cpp:4622), pid=2010, tid=2031
#  assert(false) failed: just checking
#
# JRE version: OpenJDK Runtime Environment (16.0) (slowdebug build 16-internal+0-adhoc.yangfei.openjdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (slowdebug 16-internal+0-adhoc.yangfei.openjdk-jdk, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xdf9071]  MergeMemNode::Ideal(PhaseGVN*, bool)+0x493
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c %d %P %E" (or dumping to /home/yangfei/openjdk-jdk/make/core.2010)
#
# An error report file with more information is saved as:
# /home/yangfei/openjdk-jdk/make/hs_err_pid2010.log
#
# Compiler replay data is saved as:
# /home/yangfei/openjdk-jdk/make/replay_pid2010.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
InterimImage.gmk:47: recipe for target '/home/yangfei/openjdk-jdk/build/linux-x86_64-server-slowdebug/support/interim-image/bin/java' failed
make[3]: *** [/home/yangfei/openjdk-jdk/build/linux-x86_64-server-slowdebug/support/interim-image/bin/java] Aborted (core dumped)
make/Main.gmk:576: recipe for target 'interim-image' failed
make[2]: *** [interim-image] Error 2

ERROR: Build failed for target 'install' in configuration 'linux-x86_64-server-slowdebug' (exit code 2)




More information about the hotspot-compiler-dev mailing list