7160610: Unknown Native Code compilation issue

Mon, 07 May 2012 12:37:46 -0700

author
kvn
date
Mon, 07 May 2012 12:37:46 -0700
changeset 3748
dc682d9431f3
parent 3747
ec15e8f6e4f1
child 3749
3a97daec1b34

7160610: Unknown Native Code compilation issue
Summary: When constructing input vector use type of vector's operation which use it since element's sizes should match.
Reviewed-by: never, twisti

src/share/vm/opto/superword.cpp file | annotate | diff | comparison | revisions
test/compiler/7160610/Test7160610.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/superword.cpp	Tue Apr 24 12:15:32 2012 -0700
     1.2 +++ b/src/share/vm/opto/superword.cpp	Mon May 07 12:37:46 2012 -0700
     1.3 @@ -1221,12 +1221,11 @@
     1.4        return opd; // input is matching vector
     1.5      }
     1.6      assert(!opd->is_VectorStore(), "such vector is not expected here");
     1.7 -    // Convert scalar input to vector. Use p0's type because it's container
     1.8 -    // maybe smaller than the operand's container.
     1.9 -    const Type* opd_t = velt_type(!in_bb(opd) ? p0 : opd);
    1.10 -    const Type* p0_t  = velt_type(p0);
    1.11 -    if (p0_t->higher_equal(opd_t)) opd_t = p0_t;
    1.12 -    VectorNode* vn    = VectorNode::scalar2vector(_phase->C, opd, vlen, opd_t);
    1.13 +    // Convert scalar input to vector with the same number of elements as
    1.14 +    // p0's vector. Use p0's type because size of operand's container in
    1.15 +    // vector should match p0's size regardless operand's size.
    1.16 +    const Type* p0_t = velt_type(p0);
    1.17 +    VectorNode* vn = VectorNode::scalar2vector(_phase->C, opd, vlen, p0_t);
    1.18  
    1.19      _phase->_igvn.register_new_node_with_optimizer(vn);
    1.20      _phase->set_ctrl(vn, _phase->get_ctrl(opd));
    1.21 @@ -1234,14 +1233,15 @@
    1.22    }
    1.23  
    1.24    // Insert pack operation
    1.25 -  const Type* opd_t = velt_type(!in_bb(opd) ? p0 : opd);
    1.26 -  PackNode* pk = PackNode::make(_phase->C, opd, opd_t);
    1.27 +  const Type* p0_t = velt_type(p0);
    1.28 +  PackNode* pk = PackNode::make(_phase->C, opd, p0_t);
    1.29 +  DEBUG_ONLY( const BasicType opd_bt = opd->bottom_type()->basic_type(); )
    1.30  
    1.31    for (uint i = 1; i < vlen; i++) {
    1.32      Node* pi = p->at(i);
    1.33      Node* in = pi->in(opd_idx);
    1.34      assert(my_pack(in) == NULL, "Should already have been unpacked");
    1.35 -    assert(opd_t == velt_type(!in_bb(in) ? pi : in), "all same type");
    1.36 +    assert(opd_bt == in->bottom_type()->basic_type(), "all same type");
    1.37      pk->add_opd(in);
    1.38    }
    1.39    _phase->_igvn.register_new_node_with_optimizer(pk);
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/compiler/7160610/Test7160610.java	Mon May 07 12:37:46 2012 -0700
     2.3 @@ -0,0 +1,71 @@
     2.4 +/*
     2.5 + * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
     2.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     2.7 + *
     2.8 + * This code is free software; you can redistribute it and/or modify it
     2.9 + * under the terms of the GNU General Public License version 2 only, as
    2.10 + * published by the Free Software Foundation.
    2.11 + *
    2.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
    2.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    2.14 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    2.15 + * version 2 for more details (a copy is included in the LICENSE file that
    2.16 + * accompanied this code).
    2.17 + *
    2.18 + * You should have received a copy of the GNU General Public License version
    2.19 + * 2 along with this work; if not, write to the Free Software Foundation,
    2.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    2.21 + *
    2.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    2.23 + * or visit www.oracle.com if you need additional information or have any
    2.24 + * questions.
    2.25 + *
    2.26 + */
    2.27 +
    2.28 +/**
    2.29 + * @test
    2.30 + * @bug 7160610
    2.31 + * @summary Unknown Native Code compilation issue.
    2.32 + *
    2.33 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-OptimizeFill Test7160610
    2.34 + */
    2.35 +
    2.36 +public class Test7160610 {
    2.37 +  private static final byte[] BYTE_ARRAY = new byte[7];
    2.38 +  private static int[] anIntArray1190 = new int[32768];
    2.39 +  private static int[] anIntArray1191 = new int[32768];
    2.40 +
    2.41 +  public static void main(String arg[]) {
    2.42 +    int i = 256;
    2.43 +    for(int j = BYTE_ARRAY[2]; j < anIntArray1190.length; j++) {
    2.44 +      anIntArray1190[j] = BYTE_ARRAY[2];
    2.45 +    }
    2.46 +
    2.47 +    for(int k = BYTE_ARRAY[2]; (k ^ BYTE_ARRAY[1]) > -5001; k++) {
    2.48 +      int i1 = (int)(Math.random() * 128D * (double)i);
    2.49 +      anIntArray1190[i1] = (int)(Math.random() * 256D);
    2.50 +    }
    2.51 +
    2.52 +    for(int l = BYTE_ARRAY[2]; (l ^ BYTE_ARRAY[1]) > -21; l++) {
    2.53 +      for(int j1 = BYTE_ARRAY[0]; j1 < i + -BYTE_ARRAY[0]; j1++) {
    2.54 +        for(int k1 = BYTE_ARRAY[0]; (k1 ^ BYTE_ARRAY[1]) > -128; k1++) {
    2.55 +          int l1 = k1 - -(j1 << 0x26cb6487);
    2.56 +          anIntArray1191[l1] = (anIntArray1190[l1 + -BYTE_ARRAY[0]] - -anIntArray1190[l1 - -BYTE_ARRAY[0]] - -anIntArray1190[-128 + l1] - -anIntArray1190[128 + l1]) / BYTE_ARRAY[6];
    2.57 +        }
    2.58 +      }
    2.59 +      int ai[] = anIntArray1190;
    2.60 +      anIntArray1190 = anIntArray1191;
    2.61 +      anIntArray1191 = ai;
    2.62 +    }
    2.63 +  }
    2.64 +
    2.65 +  static {
    2.66 +    BYTE_ARRAY[6] = 4;
    2.67 +    BYTE_ARRAY[5] = 5;
    2.68 +    BYTE_ARRAY[4] = 3;
    2.69 +    BYTE_ARRAY[3] = 2;
    2.70 +    BYTE_ARRAY[2] = 0;
    2.71 +    BYTE_ARRAY[1] = -1;
    2.72 +    BYTE_ARRAY[0] = 1;
    2.73 +  }
    2.74 +}

mercurial