This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
A different reg-stack.c patch
- To: egcs-patches at egcs dot cygnus dot com
- Subject: A different reg-stack.c patch
- From: hjl at valinux dot com (H.J. Lu)
- Date: Tue, 19 Oct 1999 08:32:48 -0700 (PDT)
Hi,
Jeff's patch to stack_result should work fine. But it may cost more
for most cases since it is most likely that aggregate_value_p () will
return false. I think the patch here is safe and faster since in most
cases, no function calls are needed. Please consider it.
Thanks.
--
H.J. Lu (hjl@gnu.org)
---
--- ../../../import/gcc-2.95.x/egcs/gcc/reg-stack.c Tue Oct 19 07:38:49 1999
+++ ./reg-stack.c Tue Oct 19 08:27:58 1999
@@ -1186,20 +1186,19 @@ static rtx
stack_result (decl)
tree decl;
{
- rtx result;
+ rtx result = DECL_RTL (DECL_RESULT (decl));
- /* If the value is supposed to be returned in memory, then clearly
- it is not returned in a stack register. */
- if (aggregate_value_p (DECL_RESULT (decl)))
- return 0;
-
- result = DECL_RTL (DECL_RESULT (decl));
- /* ?!? What is this code supposed to do? Can this code actually
- trigger if we kick out aggregates above? */
if (result != 0
&& ! (GET_CODE (result) == REG
&& REGNO (result) < FIRST_PSEUDO_REGISTER))
{
+ /* If the value is supposed to be returned in memory, then
+ clearly it is not returned in a stack register. */
+ if (aggregate_value_p (DECL_RESULT (decl)))
+ return 0;
+
+ /* ?!? What is this code supposed to do? Can this code actually
+ trigger if we kick out aggregates above? */
#ifdef FUNCTION_OUTGOING_VALUE
result
= FUNCTION_OUTGOING_VALUE (TREE_TYPE (DECL_RESULT (decl)), decl);