JDK-8286283 : assert(func2 == 0 && func3 == 0) failed: not unary
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • CPU: x86_64
  • Submitted: 2022-05-06
  • Updated: 2022-05-17
  • Resolved: 2022-05-16
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 18
18.0.2 masterFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Following test case results into an assertion failure with debug builds and produces incorrect results with release build of JDK-18

HOW TO REPRODUCE:

1. Ensure that the x86_64 processor supports AVX512:
$ java -XX:+PrintFlagsFinal --version | grep UseAVX
     intx UseAVX                                   = 3                                    {ARCH product} {default}

2. Run java (version 18, fastdebug) as follows:
$ java --add-modules jdk.incubator.vector logic_opt.java
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (src/hotspot/share/opto/compile.cpp:2567), pid=11089, tid=11104
#  assert(func2 == 0 && func3 == 0) failed: not unary
#
# JRE version: Java(TM) SE Runtime Environment (18.0.1+10) (fastdebug build 18.0.1+10-24)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (fastdebug 18.0.1+10-24, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0xa7865a]  Compile::compute_truth_table(Unique_Node_List&, Unique_Node_List&)+0x53a
#
# 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/rocastan/notes/bugs/8286283/core.11089)
#
# An error report file with more information is saved as:
# hs_err_pid11089.log
#
# Compiler replay data is saved as:
# replay_pid11089.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
Aborted (core dumped)
Comments
Changeset: 3d545876 Author: Jatin Bhateja <jbhateja@openjdk.org> Committer: Tobias Hartmann <thartmann@openjdk.org> Date: 2022-05-16 05:35:11 +0000 URL: https://git.openjdk.java.net/jdk18u/commit/3d5458761da1b81fdea5e6ce54db993ff0250e2d
16-05-2022

Fix Request: Problem relates to macro logic optimization which skipped processing predicated logic operations in JDK-18. Apparently the check used to test predicated IR node was incorrect and has now been replaced with stricter node flag based check. Attached reproducer results into an assertion failure with debug build and produces incorrect result with release builds. Scope of the issue is limited to JDK-18 since in JDK-19 macro logic inferencing algorithm was extended to cover predicated logic operations with significant code changes.
10-05-2022

It needs jdk18u backport request.
09-05-2022

This was fixed by JDK-8273322 in JDK 19.
09-05-2022

Hi [~rcastanedalo] Following commit link https://github.com/openjdk/jdk/commit/a59c9b2ac277d6ff6be1700d91ff389f137e61ca Thanks
07-05-2022

A pull request was submitted for review. URL: https://git.openjdk.java.net/jdk18u/pull/123 Date: 2022-05-06 11:29:46 +0000
06-05-2022

ILW = miscompilation; in incubator module, under a specific processor configuration (x86_64 with AVX-512); run with `-XX:UseAVX=2` = HLL = P4
06-05-2022

Hi [~jbhateja], could you specify which particular commit(s) integrated the masking optimizations and turned off the macro-logic optimization? Thanks!
06-05-2022

Problem is only seen with JDK-18 released version and not with JDK mainline which contains a re-designed algorithm for macrologic optimization to support predicated logic operations. During JDK-18 time frame we integrated masking related optimizations from panama-vector branch but turned off macro-logic optimization for predicated logic operations.
06-05-2022