This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: ICE: while compiling libgcc2.a -DL_eh for Alpha32.


ICE: while compiling libgcc2.a -DL_eh for Alpha32.

General background: On NT Alpha (in 32-bit mode), pointers in memory
are defined to be 32 bits (by Microsoft/DEC).  However, at the
hardware level in registers, they are 64 bits.  There is code
in gcc to handle this, wrapped around the variables Pmode (for
registers) and ptr_mode (for memory).  However, it appears that
not all instances have the correct type, or in some cases a
required conversion is omitted.  (On most machines, Pmode == ptr_mode,
so it's a "who cares".)

I will be submitting a series of small fixes, each addressing one
closely related group of such problems.  This is the first such.


Cause: in except.c, expand_eh_return, reg1, reg2, and reg3 are
created as Pmode types in the call to eh_regs.  (reg2 and reg3
directly by calls to gen_rtx_REG(Pmode..., reg1 indirectly via
build_pointer_type().)

These values all represent registers, so should be Pmode.

In expand_eh_return, these registers appear to be being stored in memory,
and need to be converted.  emit_move_insn() cannot do that, and yields
the ICE.


Fix:

1) Introduce a utility function to do this conversion (there
are more uses of it to come).  By doing this through a utility
function, a future opportunity for an optimization is eased.

2) Use it in expand_eh_return.
-- 

===================================================
Donn Terry                  mailto:donn@interix.com
Softway Systems, Inc.        http://www.interix.com
2850 McClelland Dr, Ste. 1800   Ft.Collins CO 80525
Tel: +1-970-204-9900           Fax: +1-970-204-9951
===================================================
ICE: while compiling libgcc2.a -DL_eh for Alpha32.

General background: On NT Alpha (in 32-bit mode), pointers in memory
are defined to be 32 bits (by Microsoft/DEC).  However, at the
hardware level in registers, they are 64 bits.  There is code
in gcc to handle this, wrapped around the variables Pmode (for
registers) and ptr_mode (for memory).  However, it appears that 
not all instances have the correct type, or in some cases a 
required conversion is omitted.  (On most machines, Pmode == ptr_mode,
so it's a "who cares".)

I will be submitting a series of small fixes, each addressing one
closely related group of such problems.  This is the first such.


Cause: in except.c, expand_eh_return, reg1, reg2, and reg3 are
created as Pmode types in the call to eh_regs.  (reg2 and reg3
directly by calls to gen_rtx_REG(Pmode..., reg1 indirectly via
build_pointer_type().)

These values all represent registers, so should be Pmode.

In expand_eh_return, these registers appear to be being stored in memory,
and need to be converted.  emit_move_insn() cannot do that, and yields
the ICE.


Fix:

1) Introduce a utility function to do this conversion (there
are more uses of it to come).  By doing this through a utility
function, a future opportunity for an optimization is eased.

2) Use it in expand_eh_return.


Fri Feb 19 22:27:02 1999  Donn Terry (donn@interix.com)

	* expr.h (pointer_move): Declare.
	* expr.c (pointer_move): Define.
	* except.c (expand_eh_return): Use.
	  
diff -urP egcs.source.old/gcc/expr.h egcs.source/gcc/expr.h
--- egcs.source.old/gcc/expr.h	Fri Feb  5 18:19:01 1999
+++ egcs.source/gcc/expr.h	Fri Feb  5 18:33:50 1999
@@ -723,6 +723,10 @@
    Both modes must be floating or both fixed.  */
 extern void convert_move PROTO((rtx, rtx, int));
 
+/* Emit some rtl insns to move a pointer between rtx's, where the destination
+   might be a register, and pointers in memory and in regs differ in size */
+extern rtx pointer_move PROTO((rtx, rtx));
+
 /* Convert an rtx to specified machine mode and return the result.  */
 extern rtx convert_to_mode PROTO((enum machine_mode, rtx, int));
 
diff -urP egcs.source.old/gcc/expr.c egcs.source/gcc/expr.c
--- egcs.source.old/gcc/expr.c	Fri Feb  5 18:19:00 1999
+++ egcs.source/gcc/expr.c	Fri Feb  5 18:33:49 1999
@@ -1268,6 +1268,18 @@
   abort ();
 }
 
+/* Move in-memory pointer FROM into register TO; may require widening
+   if in-memory and register pointers are different sizes.  (E.g.
+   Alpha when running NT.) */
+rtx
+pointer_move(to, from)
+     register rtx to, from;
+{
+  /* This probably can be optimized */
+  convert_move(to, from, 1);
+  return get_last_insn ();
+}
+
 /* Return an rtx for a value that would result
    from converting X to mode MODE.
    Both X and MODE may be floating, or both integer.
diff -urP egcs.source.old/gcc/except.c egcs.source/gcc/except.c
--- egcs.source.old/gcc/except.c	Fri Feb  5 18:19:00 1999
+++ egcs.source/gcc/except.c	Fri Feb  5 18:33:49 1999
@@ -2784,9 +2784,9 @@
     return;
 
   eh_regs (&reg1, &reg2, &reg3, 1);
-  emit_move_insn (reg1, eh_return_context);
-  emit_move_insn (reg2, eh_return_stack_adjust);
-  emit_move_insn (reg3, eh_return_handler);
+  pointer_move (reg1, eh_return_context);
+  pointer_move (reg2, eh_return_stack_adjust);
+  pointer_move (reg3, eh_return_handler);
 
   /* Talk directly to the target's epilogue code when possible.  */
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]