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

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

Side-by-side diff isn't available for this file because of its large size.
Issue 10389146: Fix one more bug in code generation... (Closed) Base URL: http://git.chromium.org/native_client/nacl-gcc.git@master
Patch Set: Requested changes in comments Created 8 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcc/config/i386/i386.c
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index fc37c410a8fd8cee7b710ebb09865d9bd6d46ee8..4aed8db291b00f0ca79d76da616868cae5d6cca7 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -9377,6 +9377,24 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
return 0;
}
}
+ /* Disallow direct access to addresses between 2GB and 4GB.
+
+ Example problem code:
+ int f()
+ {
+ unsigned int x = 0xf2a3e218;
+ return ((int*)x)[0];
+ }
+
+ Incorrect assembly generated with -O2:
+ movl -224140776(%r15), %eax
+ Correct assembly generated with -O2:
+ movl $4070826520, %eax
+ movl %nacl:(%r15,%rax), %eax */
+ if (TARGET_64BIT && TARGET_NACL
+ && !index_reg && base_reg && REGNO (base_reg) == R15_REG
+ && GET_CODE (disp) == CONST_INT && INTVAL (disp) < 0)
+ return 0;
/* Allow arg pointer and stack pointer as index if there is not scaling. */
if (base_reg && index_reg && scale == 1
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698