diff options
author | Uros Bizjak <uros@gcc.gnu.org> | 2015-07-15 09:28:33 +0200 |
---|---|---|
committer | Uros Bizjak <uros@gcc.gnu.org> | 2015-07-15 09:28:33 +0200 |
commit | 7a708f68bfb52c2986e2ef39bfa40a7bb3fbb51e (patch) | |
tree | b09e790e8ac470e5158ba902cf0d764743a55594 /gcc/postreload.c | |
parent | 73bf400d361db60f7c02a35fa7f5494efcc5edb3 (diff) |
re PR rtl-optimization/66838 (Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters)
PR rtl-optimization/66838
* postreload.c (reload_cse_move2add): Also process
CALL_INSN_FUNCTION_USAGE when resetting information of
call-clobbered registers.
testsuite/ChangeLog:
PR rtl-optimization/66838
* gcc.target/i386/pr66838.c: New test.
From-SVN: r225806
Diffstat (limited to 'gcc/postreload.c')
-rw-r--r-- | gcc/postreload.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c index a7eb55f293d..88d5234eef3 100644 --- a/gcc/postreload.c +++ b/gcc/postreload.c @@ -2127,12 +2127,29 @@ reload_cse_move2add (rtx_insn *first) unknown values. */ if (CALL_P (insn)) { + rtx link; + for (i = FIRST_PSEUDO_REGISTER - 1; i >= 0; i--) { if (call_used_regs[i]) /* Reset the information about this register. */ reg_mode[i] = VOIDmode; } + + for (link = CALL_INSN_FUNCTION_USAGE (insn); link; + link = XEXP (link, 1)) + { + rtx setuse = XEXP (link, 0); + rtx usage_rtx = XEXP (setuse, 0); + if (GET_CODE (setuse) == CLOBBER + && REG_P (usage_rtx)) + { + unsigned int end_regno = END_REGNO (usage_rtx); + for (unsigned int r = REGNO (usage_rtx); r < end_regno; ++r) + /* Reset the information about this register. */ + reg_mode[r] = VOIDmode; + } + } } } return changed; |