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

ARM32: TestBooleanVector crashes after 8300257

    XMLWordPrintable

Details

    • b03
    • arm

    Backports

      Description

        TestBooleanVector crashes on Arm32 after these changes:

        From 6b2a86a65ef530002aea35ded45d75e04c223802 Mon Sep 17 00:00:00 2001
        From: Roland Westrelin <roland@openjdk.org>
        Date: Fri, 7 Apr 2023 12:51:44 +0000
        Subject: [PATCH] 8300257: C2: vectorization fails on some simple Memory

        The reason for the crash is that after moving an invariant out of the loop, the vector store instruction gets an unaligned address of the array.

        ;; B20: # out( B20 B21 ) <- in( B19 B20 ) Loop( B20-B20 inner main of N111 strip mined) Freq: 1.04314e+07
         0xf3dbdd10: sub r5, r7, r6
         0xf3dbdd14: add r8, r4, r5
         0xf3dbdd18: mvn ip, #2
         0xf3dbdd1c: add r9, r8, #5
         0xf3dbdd20: add r5, r8, ip
        => 0xf3dbdd24: vstr d13, [r9]

        The issue can be reproduced using this simple program:

        public class TestBooleanVect {
         public static void main(String args[]) {
           boolean[] a = new boolean[997];
           for (int i = 0; i < 1000; i++) {
               int limit = a.length-1;
               for (int j = 0; j < a.length; j+=1) {
                     a[limit-j] = false;
               }
           }
         }
        }

        The alignment of Array likely changes on all platforms, when we move the invariant out of the loop. ARM32 doesn't allow unaligned access by vector instruction and crashes.

        Attachments

          Issue Links

            Activity

              People

                roland Roland Westrelin
                avoitylov Aleksei Voitylov
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: