/hg/icedtea6: Bug 1362: Fedora 19 / rawhide FTBFS SIGILL

chrisphi at icedtea.classpath.org chrisphi at icedtea.classpath.org
Fri Apr 5 06:04:46 PDT 2013


changeset 3584aac9d62d in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=3584aac9d62d
author: chrisphi
date: Fri Apr 05 09:01:48 2013 -0400

	Bug 1362:  Fedora 19 / rawhide FTBFS SIGILL
	Summary: Fix reg alloc problem in thumb2.cpp compiler.


diffstat:

 arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp |  30 ++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 5 deletions(-)

diffs (85 lines):

diff -r 241d297ff5e3 -r 3584aac9d62d arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp
--- a/arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp	Wed Mar 27 21:14:08 2013 +0000
+++ b/arm_port/hotspot/src/cpu/zero/vm/thumb2.cpp	Fri Apr 05 09:01:48 2013 -0400
@@ -1,5 +1,6 @@
 /*
  * Copyright 2009, 2010 Edward Nevill
+ * Copyright 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
@@ -399,6 +400,8 @@
 
 static jmp_buf compiler_error_env;
 
+#define J_BogusImplementation() longjmp(compiler_error_env, COMPILER_RESULT_FAILED)
+
 #ifdef PRODUCT
 
 #define JASSERT(cond, msg)	0
@@ -3505,8 +3508,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]; \
@@ -3516,6 +3517,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
@@ -3532,11 +3544,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;
@@ -3547,7 +3561,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;
 }
@@ -3563,7 +3580,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