diff options
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99363.patch')
-rw-r--r-- | recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99363.patch | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99363.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99363.patch new file mode 100644 index 0000000000..7003cf8376 --- /dev/null +++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99363.patch | |||
@@ -0,0 +1,95 @@ | |||
1 | 2010-08-05 Jie Zhang <jie@codesourcery.com> | ||
2 | |||
3 | Issue #7257 | ||
4 | |||
5 | Backport from mainline: | ||
6 | |||
7 | gcc/ | ||
8 | 2010-08-05 Jie Zhang <jie@codesourcery.com> | ||
9 | PR tree-optimization/45144 | ||
10 | * tree-sra.c (type_consists_of_records_p): Return false | ||
11 | if the record contains bit-field. | ||
12 | |||
13 | gcc/testsuite/ | ||
14 | 2010-08-05 Jie Zhang <jie@codesourcery.com> | ||
15 | PR tree-optimization/45144 | ||
16 | * gcc.dg/tree-ssa/pr45144.c: New test. | ||
17 | |||
18 | 2010-08-04 Mark Mitchell <mark@codesourcery.com> | ||
19 | |||
20 | Backport from mainline: | ||
21 | |||
22 | === added file 'gcc/testsuite/gcc.dg/tree-ssa/pr45144.c' | ||
23 | --- old/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c 1970-01-01 00:00:00 +0000 | ||
24 | +++ new/gcc/testsuite/gcc.dg/tree-ssa/pr45144.c 2010-08-20 16:04:44 +0000 | ||
25 | @@ -0,0 +1,46 @@ | ||
26 | +/* { dg-do compile } */ | ||
27 | +/* { dg-options "-O2 -fdump-tree-optimized" } */ | ||
28 | + | ||
29 | +void baz (unsigned); | ||
30 | + | ||
31 | +extern unsigned buf[]; | ||
32 | + | ||
33 | +struct A | ||
34 | +{ | ||
35 | + unsigned a1:10; | ||
36 | + unsigned a2:3; | ||
37 | + unsigned:19; | ||
38 | +}; | ||
39 | + | ||
40 | +union TMP | ||
41 | +{ | ||
42 | + struct A a; | ||
43 | + unsigned int b; | ||
44 | +}; | ||
45 | + | ||
46 | +static unsigned | ||
47 | +foo (struct A *p) | ||
48 | +{ | ||
49 | + union TMP t; | ||
50 | + struct A x; | ||
51 | + | ||
52 | + x = *p; | ||
53 | + t.a = x; | ||
54 | + return t.b; | ||
55 | +} | ||
56 | + | ||
57 | +void | ||
58 | +bar (unsigned orig, unsigned *new) | ||
59 | +{ | ||
60 | + struct A a; | ||
61 | + union TMP s; | ||
62 | + | ||
63 | + s.b = orig; | ||
64 | + a = s.a; | ||
65 | + if (a.a1) | ||
66 | + baz (a.a2); | ||
67 | + *new = foo (&a); | ||
68 | +} | ||
69 | + | ||
70 | +/* { dg-final { scan-tree-dump "x = a;" "optimized"} } */ | ||
71 | +/* { dg-final { cleanup-tree-dump "optimized" } } */ | ||
72 | |||
73 | === modified file 'gcc/tree-sra.c' | ||
74 | --- old/gcc/tree-sra.c 2010-08-10 13:31:21 +0000 | ||
75 | +++ new/gcc/tree-sra.c 2010-08-20 16:04:44 +0000 | ||
76 | @@ -805,7 +805,7 @@ | ||
77 | /* Return true iff TYPE is a RECORD_TYPE with fields that are either of gimple | ||
78 | register types or (recursively) records with only these two kinds of fields. | ||
79 | It also returns false if any of these records has a zero-size field as its | ||
80 | - last field. */ | ||
81 | + last field or has a bit-field. */ | ||
82 | |||
83 | static bool | ||
84 | type_consists_of_records_p (tree type) | ||
85 | @@ -821,6 +821,9 @@ | ||
86 | { | ||
87 | tree ft = TREE_TYPE (fld); | ||
88 | |||
89 | + if (DECL_BIT_FIELD (fld)) | ||
90 | + return false; | ||
91 | + | ||
92 | if (!is_gimple_reg_type (ft) | ||
93 | && !type_consists_of_records_p (ft)) | ||
94 | return false; | ||
95 | |||