aboutsummaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
authorJohn David Anglin <danglin@gcc.gnu.org>2014-12-22 23:10:18 +0000
committerJohn David Anglin <danglin@gcc.gnu.org>2014-12-22 23:10:18 +0000
commit03ce701abb566ddc1b756db9c713c0150f7acb49 (patch)
treefd53c8b633e81a3820dcf82d29ebefed910b42b5 /gcc/dse.c
parent5341599ab6d3c313e779c8ded61844acd1283649 (diff)
downloadgcc-03ce701abb566ddc1b756db9c713c0150f7acb49.zip
gcc-03ce701abb566ddc1b756db9c713c0150f7acb49.tar.gz
gcc-03ce701abb566ddc1b756db9c713c0150f7acb49.tar.bz2
re PR target/55023 (hppa: wrong code generated with tail call optimisation)
PR target/55023 * dse.c (scan_insn): Treat sibling call as though it does a wild read. * testsuite/gcc.dg/pr55023.c: New file. From-SVN: r219037
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index 2555bd1..3a7f31c 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -2483,6 +2483,17 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn)
insn_info->cannot_delete = true;
+ /* Arguments for a sibling call that are pushed to memory are passed
+ using the incoming argument pointer of the current function. These
+ may or may not be frame related depending on the target. Since
+ argument pointer related stores are not currently tracked, we treat
+ a sibling call as though it does a wild read. */
+ if (SIBLING_CALL_P (insn))
+ {
+ add_wild_read (bb_info);
+ return;
+ }
+
/* Const functions cannot do anything bad i.e. read memory,
however, they can read their parameters which may have
been pushed onto the stack.