re PR debug/61033 (Infinite loop in variable tracking)

PR debug/61033
	* g++.dg/pr61033.C: Add a regression testcase for PR debug/61033.

Co-Authored-By: Charles Baylis <charles.baylis@linaro.org>

From-SVN: r233675
This commit is contained in:
Maxim Kuvyrkov 2016-02-24 16:41:52 +00:00 committed by Maxim Kuvyrkov
parent a021961c05
commit 65433bb5b6
2 changed files with 92 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-02-24 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Charles Baylis <charles.baylis@linaro.org>
PR debug/61033
* g++.dg/pr61033.C: Add a regression testcase for PR debug/61033.
2016-02-24 Richard Biener <rguenther@suse.de>
Jakub Jelinek <jakub@redhat.com>

View File

@ -0,0 +1,86 @@
// PR debug/61033
// { dg-do compile }
// { dg-options "-g -O2" }
# 0 "" 3
struct A {
A(int) : ch() {}
unicode() {}
int ch;
};
class QChar {
public:
QChar(A ch) : ucs(ch.unicode()) {}
int ucs;
};
class B {
public:
int isShared_count;
isShared() { return isShared_count; }
};
struct C {
unsigned short *data() {
void *__trans_tmp_1;
__trans_tmp_1 = reinterpret_cast<char *>(0) + offset;
return static_cast<unsigned short *>(__trans_tmp_1);
}
B ref;
int size;
int alloc;
int offset;
};
class D {
public:
D(char *) : m_data() {} * m_data;
};
class F {
public:
F(int, QChar);
F(D);
operator+=(QChar) {
if (d->ref.isShared() || d->alloc)
reallocData();
d->data()[d->size++] = 0;
d->data()[0] = '\0';
}
C *d;
reallocData();
};
struct G {
struct H {
int begin;
};
H d;
size() { return d.begin; }
};
class I {
G p;
public:
~I();
length() { return p.size(); }
};
class J;
class K {
public:
J toNodeListProperty() const;
};
class L {
F toQml(const K &property) const;
toQml() const;
};
class J {
public:
I toModelNodeList();
};
F::F(D) {}
F L::toQml(const K &property) const {
I nodes = property.toNodeListProperty().toModelNodeList();
F result("");
F(0, A(' '));
for (int i = 0; i < nodes.length(); ++i) {
if (i)
result += A(',');
result += A('\n');
toQml();
}
}