diff options
author | Khem Raj <raj.khem@gmail.com> | 2011-04-30 12:37:47 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-05 12:26:41 +0100 |
commit | 478deec11f3349d61b1a922f047dc958dc07262a (patch) | |
tree | 1843907b36de2bcb8f821d49d8c9a88014ef0dc7 /meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch | |
parent | d42dccf886983ba14ccc868041d7bea0cf1a260e (diff) | |
download | poky-478deec11f3349d61b1a922f047dc958dc07262a.tar.gz |
gcc-4.6.0: Backport FSF 4.6 branch patches
This is set of bugfixes that has been done on
FSF gcc-4_2-branch since 4.6.0 was released
They will roll into 4.6.1 release once that
happens in coming approx 6 months time then
we can simply remove them thats the reason
so use a separate .inc file to define the
SRC_URI additions
(From OE-Core rev: b0d5b9f12adbce2c4a0df6059f5671188cd32293)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch')
-rw-r--r-- | meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch | 147 |
1 files changed, 147 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch new file mode 100644 index 0000000000..482f1dc2a8 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0162-2011-04-21-Richard-Guenther-rguenther-suse.de.patch | |||
@@ -0,0 +1,147 @@ | |||
1 | From d0c1a282504a0fa941a9ae22536c73f64d8c5762 Mon Sep 17 00:00:00 2001 | ||
2 | From: rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
3 | Date: Thu, 21 Apr 2011 14:40:53 +0000 | ||
4 | Subject: [PATCH 162/200] 2011-04-21 Richard Guenther <rguenther@suse.de> | ||
5 | |||
6 | PR middle-end/48695 | ||
7 | * tree-ssa-alias.c (aliasing_component_refs_p): Compute base | ||
8 | objects and types here. Adjust for their offset before | ||
9 | comparing. | ||
10 | |||
11 | * g++.dg/torture/pr48695.C: New testcase. | ||
12 | |||
13 | |||
14 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@172831 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
15 | |||
16 | index e26c75d..3b0e585 100644 | ||
17 | new file mode 100644 | ||
18 | index 0000000..44e6c77 | ||
19 | --- /dev/null | ||
20 | +++ b/gcc/testsuite/g++.dg/torture/pr48695.C | ||
21 | @@ -0,0 +1,38 @@ | ||
22 | +// { dg-do run } | ||
23 | + | ||
24 | +typedef __SIZE_TYPE__ size_t; | ||
25 | + | ||
26 | +inline void *operator new (size_t, void *__p) throw() { return __p; } | ||
27 | + | ||
28 | +struct _Vector_impl | ||
29 | +{ | ||
30 | + int *_M_start; | ||
31 | + int *_M_finish; | ||
32 | + _Vector_impl () :_M_start (0), _M_finish (0) {} | ||
33 | +}; | ||
34 | + | ||
35 | +struct vector | ||
36 | +{ | ||
37 | + _Vector_impl _M_impl; | ||
38 | + int *_M_allocate (size_t __n) | ||
39 | + { | ||
40 | + return __n != 0 ? new int[__n] : 0; | ||
41 | + } | ||
42 | + void push_back () | ||
43 | + { | ||
44 | + new (this->_M_impl._M_finish) int (); | ||
45 | + this->_M_impl._M_finish = | ||
46 | + this->_M_allocate (this->_M_impl._M_finish - this->_M_impl._M_start) + 1; | ||
47 | + } | ||
48 | +}; | ||
49 | + | ||
50 | +int | ||
51 | +main () | ||
52 | +{ | ||
53 | + for (int i = 0; i <= 1; i++) | ||
54 | + for (int j = 0; j <= 1; j++) | ||
55 | + { | ||
56 | + vector a[2]; | ||
57 | + a[i].push_back (); | ||
58 | + } | ||
59 | +} | ||
60 | diff --git a/gcc/tree-ssa-alias.c b/gcc/tree-ssa-alias.c | ||
61 | index bd8953b..8434179 100644 | ||
62 | --- a/gcc/tree-ssa-alias.c | ||
63 | +++ b/gcc/tree-ssa-alias.c | ||
64 | @@ -594,11 +594,11 @@ same_type_for_tbaa (tree type1, tree type2) | ||
65 | are the respective alias sets. */ | ||
66 | |||
67 | static bool | ||
68 | -aliasing_component_refs_p (tree ref1, tree type1, | ||
69 | +aliasing_component_refs_p (tree ref1, | ||
70 | alias_set_type ref1_alias_set, | ||
71 | alias_set_type base1_alias_set, | ||
72 | HOST_WIDE_INT offset1, HOST_WIDE_INT max_size1, | ||
73 | - tree ref2, tree type2, | ||
74 | + tree ref2, | ||
75 | alias_set_type ref2_alias_set, | ||
76 | alias_set_type base2_alias_set, | ||
77 | HOST_WIDE_INT offset2, HOST_WIDE_INT max_size2, | ||
78 | @@ -610,9 +610,21 @@ aliasing_component_refs_p (tree ref1, tree type1, | ||
79 | struct A { int i; int j; } *q; | ||
80 | struct B { struct A a; int k; } *p; | ||
81 | disambiguating q->i and p->a.j. */ | ||
82 | + tree base1, base2; | ||
83 | + tree type1, type2; | ||
84 | tree *refp; | ||
85 | int same_p; | ||
86 | |||
87 | + /* Choose bases and base types to search for. */ | ||
88 | + base1 = ref1; | ||
89 | + while (handled_component_p (base1)) | ||
90 | + base1 = TREE_OPERAND (base1, 0); | ||
91 | + type1 = TREE_TYPE (base1); | ||
92 | + base2 = ref2; | ||
93 | + while (handled_component_p (base2)) | ||
94 | + base2 = TREE_OPERAND (base2, 0); | ||
95 | + type2 = TREE_TYPE (base2); | ||
96 | + | ||
97 | /* Now search for the type1 in the access path of ref2. This | ||
98 | would be a common base for doing offset based disambiguation on. */ | ||
99 | refp = &ref2; | ||
100 | @@ -628,6 +640,8 @@ aliasing_component_refs_p (tree ref1, tree type1, | ||
101 | HOST_WIDE_INT offadj, sztmp, msztmp; | ||
102 | get_ref_base_and_extent (*refp, &offadj, &sztmp, &msztmp); | ||
103 | offset2 -= offadj; | ||
104 | + get_ref_base_and_extent (base1, &offadj, &sztmp, &msztmp); | ||
105 | + offset1 -= offadj; | ||
106 | return ranges_overlap_p (offset1, max_size1, offset2, max_size2); | ||
107 | } | ||
108 | /* If we didn't find a common base, try the other way around. */ | ||
109 | @@ -644,6 +658,8 @@ aliasing_component_refs_p (tree ref1, tree type1, | ||
110 | HOST_WIDE_INT offadj, sztmp, msztmp; | ||
111 | get_ref_base_and_extent (*refp, &offadj, &sztmp, &msztmp); | ||
112 | offset1 -= offadj; | ||
113 | + get_ref_base_and_extent (base2, &offadj, &sztmp, &msztmp); | ||
114 | + offset2 -= offadj; | ||
115 | return ranges_overlap_p (offset1, max_size1, offset2, max_size2); | ||
116 | } | ||
117 | |||
118 | @@ -805,11 +821,10 @@ indirect_ref_may_alias_decl_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, | ||
119 | && TREE_CODE (base1) != TARGET_MEM_REF | ||
120 | && (TREE_CODE (base1) != MEM_REF | ||
121 | || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1)) | ||
122 | - return aliasing_component_refs_p (ref1, TREE_TYPE (ptrtype1), | ||
123 | + return aliasing_component_refs_p (ref1, | ||
124 | ref1_alias_set, base1_alias_set, | ||
125 | offset1, max_size1, | ||
126 | - ref2, TREE_TYPE | ||
127 | - (reference_alias_ptr_type (ref2)), | ||
128 | + ref2, | ||
129 | ref2_alias_set, base2_alias_set, | ||
130 | offset2, max_size2, true); | ||
131 | |||
132 | @@ -952,10 +967,10 @@ indirect_refs_may_alias_p (tree ref1 ATTRIBUTE_UNUSED, tree base1, | ||
133 | || same_type_for_tbaa (TREE_TYPE (base1), TREE_TYPE (ptrtype1)) == 1) | ||
134 | && (TREE_CODE (base2) != MEM_REF | ||
135 | || same_type_for_tbaa (TREE_TYPE (base2), TREE_TYPE (ptrtype2)) == 1)) | ||
136 | - return aliasing_component_refs_p (ref1, TREE_TYPE (ptrtype1), | ||
137 | + return aliasing_component_refs_p (ref1, | ||
138 | ref1_alias_set, base1_alias_set, | ||
139 | offset1, max_size1, | ||
140 | - ref2, TREE_TYPE (ptrtype2), | ||
141 | + ref2, | ||
142 | ref2_alias_set, base2_alias_set, | ||
143 | offset2, max_size2, false); | ||
144 | |||
145 | -- | ||
146 | 1.7.0.4 | ||
147 | |||