summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch134
1 files changed, 134 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch
new file mode 100644
index 0000000000..c926a5971b
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.6.0/gcc-4_6-branch-backports/0258-PR-debug-48967.patch
@@ -0,0 +1,134 @@
1From 5581111b5be72638aebb478c70c2bafc0abd04e2 Mon Sep 17 00:00:00 2001
2From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 12 May 2011 11:59:32 +0000
4Subject: [PATCH] PR debug/48967
5 * var-tracking.c (use_narrower_mode_test) <case REG>: Return 1
6 if validate_subreg fails.
7
8 * g++.dg/opt/pr48967.C: New test.
9
10
11git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@173702 138bc75d-0d04-0410-961f-82ee72b054a4
12
13index 5e328ff..be253f4 100644
14new file mode 100644
15index 0000000..db2ea54
16--- /dev/null
17+++ b/gcc/testsuite/g++.dg/opt/pr48967.C
18@@ -0,0 +1,98 @@
19+// PR debug/48967
20+// { dg-do compile }
21+// { dg-options "-g -O2" }
22+
23+template <typename> struct A;
24+template <typename T> struct A <T *>
25+{
26+ typedef T ref;
27+};
28+template <typename T, typename> struct B
29+{
30+ typedef A <T> t;
31+ typedef typename t::ref ref;
32+ ref operator * () { return ref (); }
33+};
34+template <typename T> struct I
35+{
36+ typedef T *cp;
37+ template <typename T1> struct J
38+ {
39+ typedef I <T1> other;
40+ };
41+};
42+template <typename T> struct S : public I <T>
43+{
44+};
45+template <typename T, typename _A> struct E
46+{
47+ typedef typename _A::template J <T>::other at;
48+};
49+template <typename T, typename _A = S <T> > struct D
50+{
51+ typedef E <T, _A> _Base;
52+ typedef typename _Base::at at;
53+ typedef typename at::cp cp;
54+ typedef B <cp, D> H;
55+};
56+template <class T> struct F
57+{
58+ T *operator -> () { return __null; }
59+};
60+template <typename T> long
61+lfloor (T x)
62+{
63+ return static_cast <long>(x) - (x && x != static_cast <long>(x));
64+}
65+template <typename T> long
66+lround (T x)
67+{
68+ return lfloor (x - 0.5) + 1;
69+}
70+class M;
71+template <typename> class P;
72+typedef P <M> Q;
73+template <typename> struct P
74+{
75+ float x ();
76+};
77+struct CV
78+{
79+ Q c;
80+};
81+struct C
82+{
83+ void foo (const CV &) const;
84+ class O;
85+ typedef D <F <O> > R;
86+ R n;
87+};
88+struct S3
89+{
90+ S3 (int, int);
91+};
92+struct S2
93+{
94+ S3 sx, sy;
95+ S2 (int x = 0, int y = 0, int s = 0, int t = 0) : sx (x, y), sy (s, t) {}
96+};
97+template <typename> struct N
98+{
99+ int bar ();
100+};
101+struct C::O
102+{
103+ N <float> o;
104+ void foo (CV r, int)
105+ {
106+ Q c = r.c;
107+ float t = 0.5 * (o.bar ());
108+ S2 (lround (c.x ()), t);
109+ }
110+};
111+void
112+C::foo (const CV &w) const
113+{
114+ R::H m;
115+ (*m)->foo (w, 8);
116+}
117diff --git a/gcc/var-tracking.c b/gcc/var-tracking.c
118index 548afbc..b7ba0b9 100644
119--- a/gcc/var-tracking.c
120+++ b/gcc/var-tracking.c
121@@ -739,6 +739,10 @@ use_narrower_mode_test (rtx *loc, void *data)
122 case REG:
123 if (cselib_lookup (*loc, GET_MODE (SUBREG_REG (subreg)), 0, VOIDmode))
124 return 1;
125+ if (!validate_subreg (GET_MODE (subreg), GET_MODE (*loc),
126+ *loc, subreg_lowpart_offset (GET_MODE (subreg),
127+ GET_MODE (*loc))))
128+ return 1;
129 return -1;
130 case PLUS:
131 case MINUS:
132--
1331.7.0.4
134