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

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: 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..929b2c650c5133c9bb063fb4159f24ae67f3aac1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -9377,6 +9377,23 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
return 0;
}
}
+ /* Disallow direct accees to addresses between 2GB and 4GB.
eaeltsin 2012/05/16 13:08:37 /accees/access/
khim 2012/05/16 13:36:12 Done.
+
+ Example problem code:
+ int f()
+ {
+ unsigned int x = 0xf2a3e218;
+ return ((int*)x)[0];
+ }
+
+ Incorrect assembly generated with -O2:
+ popq %r11
+ movl -224140776(%r15), %eax
eaeltsin 2012/05/16 13:08:37 I think you can keep only this assembly line in th
khim 2012/05/16 13:36:12 Done.
+ nacljmp %r11d,%r15 */
eaeltsin 2012/05/16 13:08:37 Please add correct assembly for the example :)
khim 2012/05/16 13:36:12 Done.
+ 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