Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Unified Diff: gcc/gcc/config/i386/i386.c

Issue 2852035: [gcc] Make nacl calls CALLs. (Closed) Base URL: ssh://git@chromiumos-git/nacl-toolchain.git
Patch Set: ready for code review Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « no previous file | gcc/gcc/config/i386/i386.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/gcc/config/i386/i386.c
diff --git a/gcc/gcc/config/i386/i386.c b/gcc/gcc/config/i386/i386.c
index d72ba3391d506f2028e938c6d0959569e55226bd..235f2bf0033b95af5b4050ed6cf8650a15339413 100644
--- a/gcc/gcc/config/i386/i386.c
+++ b/gcc/gcc/config/i386/i386.c
@@ -19282,13 +19282,17 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
fnaddr = gen_rtx_MEM (QImode, fnaddr);
}
- if (!TARGET_NACL
- || (GET_CODE (fnaddr) == MEM
- && constant_call_address_operand (XEXP (fnaddr, 0), Pmode)))
- call = gen_rtx_CALL (VOIDmode, fnaddr, callarg1);
- else
- call = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (2, fnaddr, callarg1),
- UNSPEC_NACLCALL);
+ /* According to gcc internals manual, FNADDR should always be MEM.
+ At least the code above works only if FNADDR is something that has Pmode
+ expression as the first child. */
+ if (TARGET_NACL && !constant_call_address_operand (XEXP (fnaddr, 0), Pmode))
+ {
+ fnaddr = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, XEXP (fnaddr, 0)),
+ UNSPEC_NACLCALL);
+ fnaddr = gen_rtx_MEM (QImode, fnaddr);
+ }
+
+ call = gen_rtx_CALL (VOIDmode, fnaddr, callarg1);
if (retval)
call = gen_rtx_SET (VOIDmode, retval, call);
if (pop)
« no previous file with comments | « no previous file | gcc/gcc/config/i386/i386.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698