aboutsummaryrefslogtreecommitdiff
path: root/gcc/sibcall.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-04-06 19:42:22 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2002-04-06 19:42:22 +0000
commitb1896e61038b3c63b567393ba12ddaa99f6f4a43 (patch)
tree1bbe36ac9cb6e53aa6cc59b0bee82e20c63cf21e /gcc/sibcall.c
parentb01488847164f74449ebd08cd35f95660b91de8b (diff)
downloadgcc-b1896e61038b3c63b567393ba12ddaa99f6f4a43.zip
gcc-b1896e61038b3c63b567393ba12ddaa99f6f4a43.tar.gz
gcc-b1896e61038b3c63b567393ba12ddaa99f6f4a43.tar.bz2
re PR rtl-optimization/5120 (tail recursion incorrect using -O2)
PR opt/5120 * sibcall.c (optimize_sibling_and_tail_recursive_call): Clear RTX_UNCHANGING_P for the functions arguments when a tail call is made. From-SVN: r51969
Diffstat (limited to 'gcc/sibcall.c')
-rw-r--r--gcc/sibcall.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index 5a7997c..6e753fa 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -31,6 +31,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "basic-block.h"
#include "output.h"
#include "except.h"
+#include "tree.h"
/* In case alternate_exit_block contains copy from pseudo, to return value,
record the pseudo here. In such case the pseudo must be set to function
@@ -730,6 +731,7 @@ optimize_sibling_and_tail_recursive_calls ()
if (successful_sibling_call)
{
rtx insn;
+ tree arg;
/* A sibling call sequence invalidates any REG_EQUIV notes made for
this function's incoming arguments.
@@ -754,6 +756,16 @@ optimize_sibling_and_tail_recursive_calls ()
if (INSN_P (insn))
purge_mem_unchanging_flag (PATTERN (insn));
}
+
+ /* Similarly, invalidate RTX_UNCHANGING_P for any incoming
+ arguments passed in registers. */
+ for (arg = DECL_ARGUMENTS (current_function_decl);
+ arg;
+ arg = TREE_CHAIN (arg))
+ {
+ if (REG_P (DECL_RTL (arg)))
+ RTX_UNCHANGING_P (DECL_RTL (arg)) = false;
+ }
}
/* There may have been NOTE_INSN_BLOCK_{BEGIN,END} notes in the