Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4404949

Merlin: Internal Error: SoftMatchFailure is not allowed - Unsafe

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • hotspot
    • None
    • beta
    • generic
    • solaris_8

      Following test program fails with

      Fatal: SoftMatchFailure is not allowed except in product

      java -Xcomp Endian

      import java.nio.*;

      class Endian {
        public static void main(String[] args) {
          ByteBuffer bb = ByteBuffer.allocate(100);
          ByteOrder bo = bb.order();
          System.out.println(bo.toString());
        }
      }

      No matching rule for:
      --N: o100 RShiftI <== _ o99 o98 <<o84 o217 o102 o118 o110 o116 o210 7 15 18 21 >>

         --N: o99 LShiftI <== _ o78 o98 <<o100 >>

            --N: o78 ConL <== o0 <<o99 o90 >> #long[72623859790382856]
            IREGL 1 IREGL
            IO01REGL 2 IO01REGL
            IO23REGL 2 IO23REGL
            STACKSLOTL 200 regL_to_stkL

            --N: o98 ConI <== o0 <<o99 o100 >> #int:24
            IMMI 5 IMMI
            IMMI13 1 IMMI13
            IMMU13 1 IMMU13
            IMMI11 1 IMMI11
            IREGI 101 loadConI13
            NOTEMP_IREGI 103 loadConI13
            G1REGI 102 loadConI13
            O0REGI 102 loadConI13
            O1REGI 102 loadConI13
            O2REGI 102 loadConI13
            O3REGI 102 loadConI13
            O4REGI 102 loadConI13
            O5REGI 102 loadConI13
            L7REGI 102 loadConI13
            IREGP 201 moveIP
            SP_OR_IREGP 202 moveIP
            NOTEMP_IREGP 203 moveIP
            G1REGP 202 moveIP
            G3REGP 202 moveIP
            G3REGI 102 loadConI13
            G4REGP 202 moveIP
            G5REGP 202 moveIP
            I0REGP 202 moveIP
            O0REGP 202 moveIP
            O1REGP 202 moveIP
            O2REGP 202 moveIP
            O7REGP 202 moveIP
            L7REGP 202 moveIP
            O7REGI 102 loadConI13
            INLINE_CACHE_REGP 202 moveIP
            COMPILER_METHOD_OOP_REGP 202 moveIP
            INTERPRETER_METHOD_OOP_REGP 202 moveIP
            INDIRECT 301 moveIP
            STACKSLOTI 301 regI_to_stkI
            MEMORY 301 INDIRECT

         --N: o98 ConI <== o0 <<o99 o100 >> #int:24
         IMMI 5 IMMI
         IMMI13 1 IMMI13
         IMMU13 1 IMMU13
         IMMI11 1 IMMI11
         IREGI 101 loadConI13
         NOTEMP_IREGI 103 loadConI13
         G1REGI 102 loadConI13
         O0REGI 102 loadConI13
         O1REGI 102 loadConI13
         O2REGI 102 loadConI13
         O3REGI 102 loadConI13
         O4REGI 102 loadConI13
         O5REGI 102 loadConI13
         L7REGI 102 loadConI13
         IREGP 201 moveIP
         SP_OR_IREGP 202 moveIP
         NOTEMP_IREGP 203 moveIP
         G1REGP 202 moveIP
         G3REGP 202 moveIP
         G3REGI 102 loadConI13
         G4REGP 202 moveIP
         G5REGP 202 moveIP
         I0REGP 202 moveIP
         O0REGP 202 moveIP
         O1REGP 202 moveIP
         O2REGP 202 moveIP
         O7REGP 202 moveIP
         L7REGP 202 moveIP
         O7REGI 102 loadConI13
         INLINE_CACHE_REGP 202 moveIP
         COMPILER_METHOD_OOP_REGP 202 moveIP
         INTERPRETER_METHOD_OOP_REGP 202 moveIP
         INDIRECT 301 moveIP
         STACKSLOTI 301 regI_to_stkI
         MEMORY 301 INDIRECT

      #
      # HotSpot Virtual Machine Error, Internal Error
      # Please report this error at
      # http://java.sun.com/cgi-bin/bugreport.cgi
      #
      # Fatal: SoftMatchFailure is not allowed except in product
      #
      # Error ID: /files/ws/c2_work/build/solaris/../../src/share/vm/opto/matcher.hpp, 303 [ Patched ]
      #

      With sun/misc/Unsafe it's possible to store a word and reload a byte
      from the same address. The C2 optimizer tries to replace the load
      with the input to the store, but fails to consider the byteorder in
      memory. The store word and reload byte case fails on a big Endian
      machine like sparc.

      109! java.nio.Bits::byteOrder (119 bytes)
       87 IfTrue <== 81 << 90 88 95 84 >> #1
       67 Proj <== 64 << 68 71 6 77 83 90 92 >> #2 Memory: @BotPTR *+bot <idx=Bot>
       89 CastPI <== _ 69 << 90 97 >>
       78 ConL <== 0 << 84 90 >> #long[72623859790382856]
       90 StoreL <== 87 67 89 78 << 83 97 >> @rawptr:BotPTR <idx=Raw> Memory: @rawptr:BotPTR <idx=Raw>
       97 LoadB <== _ 90 89 <<>> @rawptr:BotPTR <idx=Raw> #byte

            rknippelsunw Ross Knippel (Inactive)
            rknippelsunw Ross Knippel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: