aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2001-12-05 15:17:49 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2001-12-05 15:17:49 +0100
commit1218665b70c0577046f86c7d950832dd703a67d1 (patch)
tree7da38ae698680c56e10b64fb0ae11aa0acbcc3a2 /gcc/gcse.c
parent7254c5fa7355f071477c329a9495a726810a5d63 (diff)
downloadgcc-1218665b70c0577046f86c7d950832dd703a67d1.zip
gcc-1218665b70c0577046f86c7d950832dd703a67d1.tar.gz
gcc-1218665b70c0577046f86c7d950832dd703a67d1.tar.bz2
gcse.c (store_killed_in_insn): Consider pure calls as potential store killers in addition to normal calls.
* gcse.c (store_killed_in_insn): Consider pure calls as potential store killers in addition to normal calls. * gcc.c-torture/execute/20011024-1.c: New test. From-SVN: r47675
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index e6cc513..71ee0c6 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -6498,8 +6498,21 @@ store_killed_in_insn (x, insn)
if (GET_CODE (insn) == CALL_INSN)
{
+ /* A normal or pure call might read from pattern,
+ but a const call will not. */
if (CONST_OR_PURE_CALL_P (insn))
- return 0;
+ {
+ rtx link;
+
+ for (link = CALL_INSN_FUNCTION_USAGE (insn);
+ link;
+ link = XEXP (link, 1))
+ if (GET_CODE (XEXP (link, 0)) == USE
+ && GET_CODE (XEXP (XEXP (link, 0), 0)) == MEM
+ && GET_CODE (XEXP (XEXP (XEXP (link, 0), 0), 0)) == SCRATCH)
+ return 1;
+ return 0;
+ }
else
return 1;
}