diff options
Diffstat (limited to 'meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99425.patch')
-rw-r--r-- | meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99425.patch | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99425.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99425.patch new file mode 100644 index 000000000..17839c03d --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99425.patch | |||
@@ -0,0 +1,128 @@ | |||
1 | 2010-10-26 Jie Zhang <jie@codesourcery.com> | ||
2 | |||
3 | Issue #1259 | ||
4 | |||
5 | Backport from mainline: | ||
6 | |||
7 | gcc/ | ||
8 | 2010-10-26 Jie Zhang <jie@codesourcery.com> | ||
9 | |||
10 | * stor-layout.c (layout_decl): Use the field's type to | ||
11 | determine the mode and keep DECL_BIT_FIELD for a volatile | ||
12 | bit-field. | ||
13 | * config/arm/arm.c (arm_override_options): Default to | ||
14 | -fstrict-volatile-bitfields. | ||
15 | |||
16 | gcc/testsuite/ | ||
17 | 2010-10-26 Jie Zhang <jie@codesourcery.com> | ||
18 | |||
19 | * gcc.target/arm/volatile-bitfields-1.c: New test. | ||
20 | * gcc.target/arm/volatile-bitfields-2.c: New test. | ||
21 | * gcc.target/arm/volatile-bitfields-3.c: New test. | ||
22 | |||
23 | === modified file 'gcc/config/arm/arm.c' | ||
24 | --- old/gcc/config/arm/arm.c 2010-11-04 10:45:05 +0000 | ||
25 | +++ new/gcc/config/arm/arm.c 2010-11-04 12:49:37 +0000 | ||
26 | @@ -1933,6 +1933,10 @@ | ||
27 | calculation, which is 2 instructions. */ | ||
28 | set_param_value ("gcse-unrestricted-cost", 2); | ||
29 | |||
30 | + /* ARM EABI defaults to strict volatile bitfields. */ | ||
31 | + if (TARGET_AAPCS_BASED && flag_strict_volatile_bitfields < 0) | ||
32 | + flag_strict_volatile_bitfields = 1; | ||
33 | + | ||
34 | /* Register global variables with the garbage collector. */ | ||
35 | arm_add_gc_roots (); | ||
36 | |||
37 | |||
38 | === modified file 'gcc/stor-layout.c' | ||
39 | --- old/gcc/stor-layout.c 2010-04-02 18:54:46 +0000 | ||
40 | +++ new/gcc/stor-layout.c 2010-11-04 12:49:37 +0000 | ||
41 | @@ -593,11 +593,14 @@ | ||
42 | } | ||
43 | |||
44 | /* See if we can use an ordinary integer mode for a bit-field. | ||
45 | - Conditions are: a fixed size that is correct for another mode | ||
46 | - and occupying a complete byte or bytes on proper boundary. */ | ||
47 | + Conditions are: a fixed size that is correct for another mode, | ||
48 | + occupying a complete byte or bytes on proper boundary, | ||
49 | + and not volatile or not -fstrict-volatile-bitfields. */ | ||
50 | if (TYPE_SIZE (type) != 0 | ||
51 | && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST | ||
52 | - && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT) | ||
53 | + && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT | ||
54 | + && !(TREE_THIS_VOLATILE (decl) | ||
55 | + && flag_strict_volatile_bitfields > 0)) | ||
56 | { | ||
57 | enum machine_mode xmode | ||
58 | = mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1); | ||
59 | |||
60 | === added file 'gcc/testsuite/gcc.target/arm/volatile-bitfields-1.c' | ||
61 | --- old/gcc/testsuite/gcc.target/arm/volatile-bitfields-1.c 1970-01-01 00:00:00 +0000 | ||
62 | +++ new/gcc/testsuite/gcc.target/arm/volatile-bitfields-1.c 2010-11-04 12:49:37 +0000 | ||
63 | @@ -0,0 +1,18 @@ | ||
64 | +/* { dg-require-effective-target arm_eabi } */ | ||
65 | +/* { dg-do compile } */ | ||
66 | +/* { dg-options "-O2" } */ | ||
67 | + | ||
68 | +typedef struct { | ||
69 | + char a:1; | ||
70 | + char b:7; | ||
71 | + int c; | ||
72 | +} BitStruct; | ||
73 | + | ||
74 | +volatile BitStruct bits; | ||
75 | + | ||
76 | +int foo () | ||
77 | +{ | ||
78 | + return bits.b; | ||
79 | +} | ||
80 | + | ||
81 | +/* { dg-final { scan-assembler "ldrb\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" } } */ | ||
82 | |||
83 | === added file 'gcc/testsuite/gcc.target/arm/volatile-bitfields-2.c' | ||
84 | --- old/gcc/testsuite/gcc.target/arm/volatile-bitfields-2.c 1970-01-01 00:00:00 +0000 | ||
85 | +++ new/gcc/testsuite/gcc.target/arm/volatile-bitfields-2.c 2010-11-04 12:49:37 +0000 | ||
86 | @@ -0,0 +1,18 @@ | ||
87 | +/* { dg-require-effective-target arm_eabi } */ | ||
88 | +/* { dg-do compile } */ | ||
89 | +/* { dg-options "-O2" } */ | ||
90 | + | ||
91 | +typedef struct { | ||
92 | + volatile unsigned long a:8; | ||
93 | + volatile unsigned long b:8; | ||
94 | + volatile unsigned long c:16; | ||
95 | +} BitStruct; | ||
96 | + | ||
97 | +BitStruct bits; | ||
98 | + | ||
99 | +unsigned long foo () | ||
100 | +{ | ||
101 | + return bits.b; | ||
102 | +} | ||
103 | + | ||
104 | +/* { dg-final { scan-assembler "ldr\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" } } */ | ||
105 | |||
106 | === added file 'gcc/testsuite/gcc.target/arm/volatile-bitfields-3.c' | ||
107 | --- old/gcc/testsuite/gcc.target/arm/volatile-bitfields-3.c 1970-01-01 00:00:00 +0000 | ||
108 | +++ new/gcc/testsuite/gcc.target/arm/volatile-bitfields-3.c 2010-11-04 12:49:37 +0000 | ||
109 | @@ -0,0 +1,18 @@ | ||
110 | +/* { dg-require-effective-target arm_eabi } */ | ||
111 | +/* { dg-do compile } */ | ||
112 | +/* { dg-options "-O2" } */ | ||
113 | + | ||
114 | +typedef struct { | ||
115 | + volatile unsigned long a:8; | ||
116 | + volatile unsigned long b:8; | ||
117 | + volatile unsigned long c:16; | ||
118 | +} BitStruct; | ||
119 | + | ||
120 | +BitStruct bits; | ||
121 | + | ||
122 | +unsigned long foo () | ||
123 | +{ | ||
124 | + return bits.c; | ||
125 | +} | ||
126 | + | ||
127 | +/* { dg-final { scan-assembler "ldr\[\\t \]+\[^\n\]*,\[\\t \]*\\\[\[^\n\]*\\\]" } } */ | ||
128 | |||