This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: ICE, Alpha32 g++.robertl/eb101.C -- take 2
- To: "egcs-patches at egcs dot cygnus dot com" <egcs-patches at egcs dot cygnus dot com>
- Subject: Re: Patch: ICE, Alpha32 g++.robertl/eb101.C -- take 2
- From: Donn Terry <donn at interix dot com>
- Date: Wed, 05 May 1999 08:18:36 -0600
- References: <372F0C09.F4033843@interix.com>
A refresh and minor fix of this patch.
Donn
===================================================
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
===================================================
Problem: ICE, Alpha32 g++.robertl/eb101.C
Fix:
When calling chkr_check_exec_libfunc, the arg needs to be an
in-register (or pseudo) pointer (Pmode). A prior patch fixes
that. However, the argument needs to actually be promoted to
that type on machines where Pmode != ptr_mode. Do that as
well.
ChangeLog
Wed May 5 08:22:42 1999 Donn Terry (donn@interix.com)
* calls.c (rtx_for_function_call): Extend function pointer being
passed to chkr_check_exec_libfunc, if needed.
diff -urP egcs.source.old/gcc/calls.c egcs.source/gcc/calls.c
--- egcs.source.old/gcc/calls.c Tue May 4 17:44:03 1999
+++ egcs.source/gcc/calls.c Wed May 5 08:07:59 1999
@@ -1407,15 +1407,25 @@ rtx_for_function_call (fndecl, exp)
else
/* Generate an rtx (probably a pseudo-register) for the address. */
{
+ rtx funaddr;
push_temp_slots ();
- funexp = expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
+ funaddr = funexp =
+ expand_expr (TREE_OPERAND (exp, 0), NULL_RTX, VOIDmode, 0);
pop_temp_slots (); /* FUNEXP can't be BLKmode */
/* Check the function is executable. */
if (current_function_check_memory_usage)
- emit_library_call (chkr_check_exec_libfunc, 1,
- VOIDmode, 1,
- funexp, Pmode);
+ {
+#ifdef POINTERS_EXTEND_UNSIGNED
+ /* It might be OK to convert funexp in place, but there's
+ a lot going on between here and when it happens naturally
+ that this seems safer. */
+ funaddr = convert_memory_address (Pmode, funexp);
+#endif
+ emit_library_call (chkr_check_exec_libfunc, 1,
+ VOIDmode, 1,
+ funaddr, Pmode);
+ }
emit_queue ();
}
return funexp;