From: Jakub Jelinek Date: Wed, 14 Mar 2001 17:59:03 +0000 (+0100) Subject: reg-stack.c (stack_result): Unconditionally use FUNCTION_OUTGOING_VALUE resp. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9cf218a30f2076faeeb43df2f3b422fc65f59c0e;p=gcc.git reg-stack.c (stack_result): Unconditionally use FUNCTION_OUTGOING_VALUE resp. * reg-stack.c (stack_result): Unconditionally use FUNCTION_OUTGOING_VALUE resp. FUNCTION_VALUE. * g++.old-deja/g++.other/regstack.C: New test. From-SVN: r40457 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 54031ae237a..dd2818dadbb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-03-14 Jakub Jelinek + + * reg-stack.c (stack_result): Unconditionally use + FUNCTION_OUTGOING_VALUE resp. FUNCTION_VALUE. + Wed Mar 14 16:36:25 CET 2001 Jan Hubicka * expr.c (emit_move_insn_1): Split push of complex value when diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c index 1d14a013cee..2f00113bab5 100644 --- a/gcc/reg-stack.c +++ b/gcc/reg-stack.c @@ -786,11 +786,7 @@ stack_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 (result != 0) { #ifdef FUNCTION_OUTGOING_VALUE result diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c86f7502246..3198df8e22c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-03-14 Jakub Jelinek + + * g++.old-deja/g++.other/regstack.C: New test. + 2001-03-12 Nathan Sidwell * g++.old-deja/g++.other/ref4.C: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.other/regstack.C b/gcc/testsuite/g++.old-deja/g++.other/regstack.C new file mode 100644 index 00000000000..ea7222156de --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/regstack.C @@ -0,0 +1,31 @@ +// Special g++ Options: -O2 +// Skip if not target: i?86-*-* + +inline double foo (double x) +{ + register double r; + asm volatile ("fsqrt" : "=t" (r) : "0" (x)); + return r; +} + +struct X +{ + ~X() {} +}; + +int b; + +double bar (X x) +{ + if (b) + return 1.0; + return 36.0 * foo (36.0); +} + +int main () +{ + X x; + if (bar (x) != 216.0) + return 1; + return 0; +}