test/compiler/loopopts/superword/TestNegBaseOffset.java

Fri, 15 Jun 2018 08:28:08 -0700

author
kvn
date
Fri, 15 Jun 2018 08:28:08 -0700
changeset 9740
b290489738b8
permissions
-rw-r--r--

8202948: C2: assert(init_offset >= 0) failed: positive offset from object start
Summary: convert the assert into compilation check which will skip superword optimization
Reviewed-by: roland, thartmann

kvn@9740 1 /*
kvn@9740 2 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
kvn@9740 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
kvn@9740 4 *
kvn@9740 5 * This code is free software; you can redistribute it and/or modify it
kvn@9740 6 * under the terms of the GNU General Public License version 2 only, as
kvn@9740 7 * published by the Free Software Foundation.
kvn@9740 8 *
kvn@9740 9 * This code is distributed in the hope that it will be useful, but WITHOUT
kvn@9740 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
kvn@9740 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kvn@9740 12 * version 2 for more details (a copy is included in the LICENSE file that
kvn@9740 13 * accompanied this code).
kvn@9740 14 *
kvn@9740 15 * You should have received a copy of the GNU General Public License version
kvn@9740 16 * 2 along with this work; if not, write to the Free Software Foundation,
kvn@9740 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
kvn@9740 18 *
kvn@9740 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
kvn@9740 20 * or visit www.oracle.com if you need additional information or have any
kvn@9740 21 * questions.
kvn@9740 22 */
kvn@9740 23
kvn@9740 24 /*
kvn@9740 25 * @test
kvn@9740 26 * @bug 8202948
kvn@9740 27 * @summary Test skipping vector packs with negative base offset.
kvn@9740 28 * @comment Test fails only with -Xcomp when profiling data is not present.
kvn@9740 29 * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions
kvn@9740 30 * -Xcomp -XX:-TieredCompilation -XX:CICompilerCount=1
kvn@9740 31 * -XX:CompileOnly=compiler/loopopts/superword/TestNegBaseOffset
kvn@9740 32 * compiler.loopopts.superword.TestNegBaseOffset
kvn@9740 33 */
kvn@9740 34
kvn@9740 35 package compiler.loopopts.superword;
kvn@9740 36
kvn@9740 37 public class TestNegBaseOffset {
kvn@9740 38 public static final int N = 400;
kvn@9740 39 public static int iFld=10;
kvn@9740 40 public static int iArr[]=new int[N];
kvn@9740 41
kvn@9740 42 public static void mainTest() {
kvn@9740 43 int i0=1, i2;
kvn@9740 44 while (++i0 < 339) {
kvn@9740 45 if ((i0 % 2) == 0) {
kvn@9740 46 for (i2 = 2; i2 > i0; i2 -= 3) {
kvn@9740 47 iArr[i2 - 1] &= iFld;
kvn@9740 48 }
kvn@9740 49 }
kvn@9740 50 }
kvn@9740 51 }
kvn@9740 52
kvn@9740 53 public static void main(String[] strArr) {
kvn@9740 54 for (int i = 0; i < 10; i++) {
kvn@9740 55 mainTest();
kvn@9740 56 }
kvn@9740 57 }
kvn@9740 58 }
kvn@9740 59

mercurial