Skip to content

Commit ce8367f

Browse files
committed
8288781: C1: LIR_OpVisitState::maxNumberOfOperands too small
Backport-of: 3f5e48a44ee77d07dea3d2c4ae52aaf19b8dc7cb
1 parent 1c96cac commit ce8367f

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

src/hotspot/share/c1/c1_LIR.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -2333,7 +2333,7 @@ class LIR_OpVisitState: public StackObj {
23332333
typedef enum { inputMode, firstMode = inputMode, tempMode, outputMode, numModes, invalidMode = -1 } OprMode;
23342334

23352335
enum {
2336-
maxNumberOfOperands = 20,
2336+
maxNumberOfOperands = 21,
23372337
maxNumberOfInfos = 4
23382338
};
23392339

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (c) 2022 SAP SE. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*
23+
*/
24+
25+
/**
26+
* @test
27+
* @bug 8288781
28+
* @summary Test if a call with 8 integer + 13 float = 21 parameters can can be compiled.
29+
* On ppc all parameters can be passed in registers.
30+
* @author Richard Reingruber
31+
*
32+
* @run main/othervm -Xbatch -XX:CompileCommand=dontinline,*::*dontinline* compiler.c1.TestManyMethodParameters
33+
*/
34+
35+
package compiler.c1;
36+
37+
public class TestManyMethodParameters {
38+
public static void main(String[] args) {
39+
for (int i = 30_000; i >= 0; i--) {
40+
double sum = testMethod_01_dontinline();
41+
if (sum != 127) {
42+
throw new Error("Wrong sum: " + sum);
43+
}
44+
}
45+
}
46+
47+
public static double testMethod_01_dontinline() {
48+
return testMethod_01_manyArgs(1, 2, 3, 4, 5, 6, 7, 8,
49+
1.0d, 2.0d, 3.0d, 4.0d, 5.0d, 6.0d, 7.0d, 8.0d, 9.0d, 10.0d, 11.0d, 12.0d, 13.0d);
50+
}
51+
52+
public static double testMethod_01_manyArgs(long l1, long l2, long l3, long l4, long l5, long l6, long l7, long l8,
53+
double d1, double d2, double d3, double d4, double d5, double d6, double d7,
54+
double d8, double d9, double d10, double d11, double d12, double d13) {
55+
return l1+l2+l3+l4+l5+l6+l7+l8+d1+d2+d3+d4+d5+d6+d7+d8+d9+d10+d11+d12+d13;
56+
}
57+
}

0 commit comments

Comments
 (0)