Summary: | [5 Regression] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters | ||
---|---|---|---|
Product: | gcc | Reporter: | Michal Růžička <michal.ruza> |
Component: | rtl-optimization | Assignee: | Uroš Bizjak <ubizjak> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | austinenglish, law, marcus, ubizjak |
Priority: | P3 | ||
Version: | 5.1.1 | ||
Target Milestone: | 5.3 | ||
Host: | Target: | x86_64 | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2015-07-12 00:00:00 | |
Attachments: |
clobber_repro.c
Untested patch |
Description
Michal Růžička
2015-07-11 00:59:00 UTC
Confirmed, this one is in postreload pass. The testcase from Comment #0, when compiled with -O2 creates following dumps: Register allocator creates correct sequence, _.reload dump shows for ms_abi_func: 2: NOTE_INSN_FUNCTION_BEG 5: si:DI=`global' 6: di:DI=`*.LC2' 7: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 8: si:DI=`global' 9: di:DI=`*.LC3' 10: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 11: si:DI=`global' 12: di:DI=`*.LC4' 13: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 16: NOTE_INSN_DELETED and _.postreload shows: 2: NOTE_INSN_FUNCTION_BEG 5: si:DI=`global' 6: di:DI=`*.LC2' 7: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 8: si:DI=si:DI 9: di:DI=`*.LC3' 10: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 11: si:DI=si:DI 12: di:DI=`*.LC4' 13: call [`sysv_abi_func'] argc:0 REG_EH_REGION 0 16: NOTE_INSN_DELETED Please note invalid SI register propagation through function call to (insn 8) and (insn 11). Confirmed as rtl-optimization problem, CC added. *** Bug 66845 has been marked as a duplicate of this bug. *** Created attachment 35961 [details]
Untested patch
Patch that adds missing CALL_INSN_FUNCTION_USAGE processing to postreload.c/reload_cse_move2add.
Author: uros Date: Wed Jul 15 07:28:33 2015 New Revision: 225806 URL: https://gcc.gnu.org/viewcvs?rev=225806&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/gcc.target/i386/pr66838.c Modified: trunk/gcc/ChangeLog trunk/gcc/postreload.c trunk/gcc/testsuite/ChangeLog Fixed for mainline, needs backport to gcc-5 branch. GCC 5.2 is being released, adjusting target milestone to 5.3. Author: uros Date: Fri Jul 17 13:50:38 2015 New Revision: 225935 URL: https://gcc.gnu.org/viewcvs?rev=225935&root=gcc&view=rev Log: Backport from mainline: 2015-07-15 Uros Bizjak <ubizjak@gmail.com> PR rtl-optimization/66838 * postreload.c (reload_cse_move2add): Also process CALL_INSN_FUNCTION_USAGE when resetting information of call-clobbered registers. testsuite/ChangeLog: Backport from mainline: 2015-07-15 Uros Bizjak <ubizjak@gmail.com> PR rtl-optimization/66838 * gcc.target/i386/pr66838.c: New test. Added: branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66838.c Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/postreload.c branches/gcc-5-branch/gcc/testsuite/ChangeLog Fixed. |