summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch')
-rw-r--r--recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch114
1 files changed, 114 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch
new file mode 100644
index 0000000000..80dbe3f71a
--- /dev/null
+++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99423.patch
@@ -0,0 +1,114 @@
12010-10-25 Jie Zhang <jie@codesourcery.com>
2
3 Issue #9812
4
5 Backport from mainline:
6
7 gcc/
8 2010-10-25 Jie Zhang <jie@codesourcery.com>
9 * combine.c (try_combine): If insns need to be kept around,
10 check that they can be copied in the merged instruction.
11
12 gcc/testsuite/
13 2010-10-25 Jie Zhang <jie@codesourcery.com>
14 * g++.dg/opt/combine.c: New test.
15
16=== modified file 'gcc/combine.c'
17--- old/gcc/combine.c 2010-09-20 22:37:32 +0000
18+++ new/gcc/combine.c 2010-11-04 12:39:28 +0000
19@@ -2809,6 +2809,17 @@
20 = i1 && ! (i1_feeds_i3 ? dead_or_set_p (i3, i1dest)
21 : (dead_or_set_p (i3, i1dest) || dead_or_set_p (i2, i1dest)));
22
23+ /* We are about to copy insns for the case where they need to be kept
24+ around. Check that they can be copied in the merged instruction. */
25+
26+ if (targetm.cannot_copy_insn_p
27+ && ((added_sets_2 && targetm.cannot_copy_insn_p (i2))
28+ || (i1 && added_sets_1 && targetm.cannot_copy_insn_p (i1))))
29+ {
30+ undo_all ();
31+ return 0;
32+ }
33+
34 /* If the set in I2 needs to be kept around, we must make a copy of
35 PATTERN (I2), so that when we substitute I1SRC for I1DEST in
36 PATTERN (I2), we are only substituting for the original I1DEST, not into
37
38=== added file 'gcc/testsuite/g++.dg/opt/combine.C'
39--- old/gcc/testsuite/g++.dg/opt/combine.C 1970-01-01 00:00:00 +0000
40+++ new/gcc/testsuite/g++.dg/opt/combine.C 2010-11-04 12:39:28 +0000
41@@ -0,0 +1,72 @@
42+// { dg-do assemble { target fpic } }
43+// { dg-options "-O2 -fweb -fPIC -fvisibility=hidden" }
44+
45+class QBasicAtomicInt
46+{
47+public:
48+ volatile int _q_value;
49+ inline operator int () const {return _q_value;}
50+};
51+class QVariant;
52+class QScriptContext;
53+class QScriptEngine;
54+class QScriptValue
55+{
56+public:
57+ QVariant toVariant () const;
58+};
59+class QScriptDebuggerBackendPrivate
60+{
61+ static QScriptValue trace (QScriptContext *context);
62+};
63+template <typename T> struct QMetaTypeId { };
64+template <typename T> struct QMetaTypeId2
65+{
66+ static inline int qt_metatype_id ()
67+ {
68+ return QMetaTypeId<T>::qt_metatype_id () ;
69+ }
70+};
71+template <typename T> inline int qMetaTypeId (T * = 0)
72+{
73+ return QMetaTypeId2<T>::qt_metatype_id () ;
74+}
75+class QVariant { };
76+template<typename T> inline T qvariant_cast (const QVariant &v)
77+{
78+ const int vid = qMetaTypeId<T> ((0)) ;
79+};
80+class QScriptContext
81+{
82+public:
83+ QScriptValue callee () const;
84+};
85+class QScriptEngine
86+{
87+public:
88+ static bool convertV2 (const QScriptValue &value , int type , void *ptr) ;
89+};
90+inline bool qscriptvalue_cast_helper (const QScriptValue &value , int type , void *ptr)
91+{
92+ return QScriptEngine::convertV2 (value, type, ptr) ;
93+}
94+template<typename T> T qscriptvalue_cast (const QScriptValue &value)
95+{
96+ T t;
97+ const int id = qMetaTypeId<T> () ;
98+ if ( qscriptvalue_cast_helper (value, id, &t))
99+ return qvariant_cast<T> (value.toVariant ()) ;
100+}
101+template <> struct QMetaTypeId< QScriptDebuggerBackendPrivate* >
102+{
103+ static int qt_metatype_id ()
104+ {
105+ static QBasicAtomicInt metatype_id = { (0) };
106+ return metatype_id;
107+ }
108+};
109+QScriptValue QScriptDebuggerBackendPrivate::trace (QScriptContext *context)
110+{
111+ QScriptValue data = context->callee () ;
112+ QScriptDebuggerBackendPrivate *self = qscriptvalue_cast<QScriptDebuggerBackendPrivate*> (data) ;
113+}
114