summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch
new file mode 100644
index 0000000..9c86817
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/volatile_access_backport.patch
@@ -0,0 +1,28 @@
1Pulled from http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01477.html
2
3Upstream-Status: Backport
4
5Signed-off-by: Saul Wold <sgw@linux.intel.com>
6
7 gcc/
8 * expr.c (expand_expr_real_1): Only use BLKmode for volatile
9 accesses which are not naturally aligned.
10
11Index: gcc-4.6.0/gcc/expr.c
12===================================================================
13--- gcc-4.6.0.orig/gcc/expr.c 2011-06-01 15:28:55.000000000 -0700
14+++ gcc-4.6.0/gcc/expr.c 2011-06-01 15:41:17.154848182 -0700
15@@ -9178,8 +9178,11 @@
16 && modifier != EXPAND_CONST_ADDRESS
17 && modifier != EXPAND_INITIALIZER)
18 /* If the field is volatile, we always want an aligned
19- access. */
20- || (volatilep && flag_strict_volatile_bitfields > 0)
21+ access. Only do this if the access is not already naturally
22+ aligned, otherwise "normal" (non-bitfield) volatile fields
23+ become non-addressable. */
24+ || (volatilep && flag_strict_volatile_bitfields > 0
25+ && (bitpos % GET_MODE_ALIGNMENT (mode) != 0))
26 /* If the field isn't aligned enough to fetch as a memref,
27 fetch it as a bit field. */
28 || (mode1 != BLKmode