From 65433bb5b64b62dc66c850e312e3edd8236535d9 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 24 Feb 2016 16:41:52 +0000 Subject: [PATCH] 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 From-SVN: r233675 --- gcc/testsuite/ChangeLog | 6 +++ gcc/testsuite/g++.dg/pr61033.C | 86 ++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 gcc/testsuite/g++.dg/pr61033.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2e4158839c9..7db6b61f86a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-02-24 Maxim Kuvyrkov + Charles Baylis + + PR debug/61033 + * g++.dg/pr61033.C: Add a regression testcase for PR debug/61033. + 2016-02-24 Richard Biener Jakub Jelinek diff --git a/gcc/testsuite/g++.dg/pr61033.C b/gcc/testsuite/g++.dg/pr61033.C new file mode 100644 index 00000000000..6974351a9c0 --- /dev/null +++ b/gcc/testsuite/g++.dg/pr61033.C @@ -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(0) + offset; + return static_cast(__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(); + } +}