Donn Terry (donn@interix.com)
authorDonn Terry <donn@interix.com>
Sat, 8 May 1999 01:58:39 +0000 (01:58 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 8 May 1999 01:58:39 +0000 (18:58 -0700)
Donn Terry (donn@interix.com)
        * calls.c (rtx_for_function_call): Extend function pointer being
        passed to chkr_check_exec_libfunc, if needed.

From-SVN: r26838

gcc/ChangeLog
gcc/calls.c

index 3db908541fcda8a1fbdcf11a746d02a8d16214f3..e5f28311099c068fd0bcf1d28b4e8edcf47a7eb8 100644 (file)
@@ -1,3 +1,8 @@
+Sat May  8 01:57:58 1999  Donn Terry (donn@interix.com)
+
+       * calls.c (rtx_for_function_call): Extend function pointer being
+       passed to chkr_check_exec_libfunc, if needed.
+
 Sat May  8 01:51:50 1999  David Edelsohn  <edelsohn@gnu.org>
 
        * ginclude/stdarg.h (__va_rounded_size): Use long type for
index 03bac91251bf73d0d632566bc0f2cdecadae559b..d0153a3d1249bbf5d3549aead9df22c51e14d6f1 100644 (file)
@@ -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;