diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-08 13:12:03 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-08 13:12:03 +0000 |
commit | cc0595c0a5a0ab03fba105bb1dbe856557b1a988 (patch) | |
tree | 12985c1b71115046191bb5215bc72531f64397e2 /gcc/calls.c | |
parent | 46161cc20e525ff2f0e9e83332068945d3e549b6 (diff) | |
download | gcc-cc0595c0a5a0ab03fba105bb1dbe856557b1a988.tar.gz |
Fix PR middle-end/49519.
gcc/
2011-07-08 Kirill Yukhin <kirill.yukhin@intel.com>
PR middle-end/49519
* calls.c (mem_overlaps_already_clobbered_arg_p): Additional
check if address is stored in register. If so - give up.
(check_sibcall_argument_overlap_1): Do not perform check of
overlapping when it is call to address.
gcc/tessuite/
2011-07-08 Kirill Yukhin <kirill.yukhin@intel.com>
PR middle-end/49519
* g++.dg/torture/pr49519.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@176042 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/calls.c')
-rw-r--r-- | gcc/calls.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/calls.c b/gcc/calls.c index 7538e4e5040..0cd8cc9dbcb 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -1591,6 +1591,10 @@ mem_overlaps_already_clobbered_arg_p (rtx addr, unsigned HOST_WIDE_INT size) && (XEXP (addr, 0) == crtl->args.internal_arg_pointer || XEXP (addr, 1) == crtl->args.internal_arg_pointer)) return true; + /* If the address comes in a register, we have no idea of its origin so + give up and conservatively return true. */ + else if (REG_P(addr)) + return true; else return false; @@ -1831,6 +1835,10 @@ check_sibcall_argument_overlap_1 (rtx x) code = GET_CODE (x); + /* We need not check the operands of the CALL expression itself. */ + if (code == CALL) + return 0; + if (code == MEM) return mem_overlaps_already_clobbered_arg_p (XEXP (x, 0), GET_MODE_SIZE (GET_MODE (x))); |