/hg/release/icedtea7-forest-2.1/hotspot: Bug : Fedora 19 /...
chrisphi at icedtea.classpath.org
chrisphi at icedtea.classpath.org
Thu Mar 21 08:32:30 PDT 2013
changeset 4e4dd75d54e7 in /hg/release/icedtea7-forest-2.1/hotspot
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.1/hotspot?cmd=changeset;node=4e4dd75d54e7
author: chrisphi
date: Thu Mar 21 11:17:13 2013 -0400
Bug : Fedora 19 / rawhide FTBFS SIGILL
Summary: Changed thumb2 PUSH & POP to inline functions ,
added detection of reg alloc failure, fails compile of method.
diffstat:
src/cpu/zero/vm/thumb2.cpp | 31 +++++++++++++++++++++++++------
1 files changed, 25 insertions(+), 6 deletions(-)
diffs (86 lines):
diff -r f6f4d5e6c1dd -r 4e4dd75d54e7 src/cpu/zero/vm/thumb2.cpp
--- a/src/cpu/zero/vm/thumb2.cpp Wed Mar 13 07:19:51 2013 +0000
+++ b/src/cpu/zero/vm/thumb2.cpp Thu Mar 21 11:17:13 2013 -0400
@@ -1,6 +1,6 @@
/*
* Copyright 2009, 2010 Edward Nevill
- * Copyright 2012, Red Hat
+ * Copyright 2012, 2013 Red Hat
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
@@ -426,6 +426,8 @@
static jmp_buf compiler_error_env;
+#define J_BogusImplementation() longjmp(compiler_error_env, COMPILER_RESULT_FAILED)
+
#ifdef PRODUCT
#define JASSERT(cond, msg) 0
@@ -3245,8 +3247,6 @@
#define TOSM2(jstack) ((jstack)->stack[(jstack)->depth-3])
#define TOSM3(jstack) ((jstack)->stack[(jstack)->depth-4])
-#define POP(jstack) ((jstack)->stack[--(jstack)->depth])
-#define PUSH(jstack, r) ((jstack)->stack[(jstack)->depth++] = (r))
#define SWAP(jstack) do { \
Reg r = (jstack)->stack[(jstack)->depth-1]; \
(jstack)->stack[(jstack)->depth-1] = (jstack)->stack[(jstack)->depth-2]; \
@@ -3256,6 +3256,17 @@
#define JSTACK_REG(jstack) jstack_reg(jstack)
#define JSTACK_PREFER(jstack, prefer) jstack_prefer(jstack, prefer)
+int PUSH(Thumb2_Stack *jstack, unsigned reg) {
+ jstack->stack[jstack->depth] = reg;
+ jstack->depth++;
+ return reg;
+}
+
+int POP(Thumb2_Stack *jstack) {
+ jstack->depth--;
+ return jstack->stack[jstack->depth];
+}
+
static const unsigned last_clear_bit[] = {
3, // 0000
3, // 0001
@@ -3272,11 +3283,13 @@
1, // 1100
1, // 1101
0, // 1110
- 0, // 1111
+ 0, // 1111 // No registers available...
};
#define LAST_CLEAR_BIT(mask) last_clear_bit[mask]
+unsigned long thumb2_register_allocation_failures = 0;
+
unsigned jstack_reg(Thumb2_Stack *jstack)
{
unsigned *stack = jstack->stack;
@@ -3287,7 +3300,10 @@
for (i = 0; i < depth; i++) mask |= 1 << stack[i];
mask &= (1 << STACK_REGS) - 1;
- JASSERT(mask != (1 << STACK_REGS) - 1, "No free reg in push");
+ if (mask >= (1 << STACK_REGS) - 1) { // No free registers
+ thumb2_register_allocation_failures++;
+ J_BogusImplementation();
+ }
r = LAST_CLEAR_BIT(mask);
return r;
}
@@ -3303,7 +3319,10 @@
for (i = 0; i < depth; i++) mask |= 1 << stack[i];
mask &= (1 << STACK_REGS) - 1;
if ((prefer & ~mask) & 0x0f) mask |= (~prefer & ((1 << STACK_REGS) - 1));
- JASSERT(mask != (1 << STACK_REGS) - 1, "No free reg in push");
+ if (mask >= (1 << STACK_REGS) - 1) { // No free registers
+ thumb2_register_allocation_failures++;
+ J_BogusImplementation();
+ }
r = LAST_CLEAR_BIT(mask);
return r;
}
More information about the distro-pkg-dev
mailing list