aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-08-03 14:44:54 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-08-03 07:44:54 -0700
commitac88396b5e3bf22b4013339e7980a748d88eddf7 (patch)
tree6f59fc1c78e261d63109d6d61c0cd299596a55c3 /gcc
parentdeb8dacccffd4eda62517772bef5fd90e03776d7 (diff)
downloadgcc-ac88396b5e3bf22b4013339e7980a748d88eddf7.zip
gcc-ac88396b5e3bf22b4013339e7980a748d88eddf7.tar.gz
gcc-ac88396b5e3bf22b4013339e7980a748d88eddf7.tar.bz2
Add a testcase for PR middle-end/47383.
2011-08-03 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/47383 * gcc.dg/torture/pr47383.c: Likewise. From-SVN: r177277
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr47383.c30
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2dc9a1d..a157259 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-08-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47383
+ * gcc.dg/torture/pr47383.c: Likewise.
+
2011-08-03 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/specs/debug1.ads: Add missing -margs switch.
diff --git a/gcc/testsuite/gcc.dg/torture/pr47383.c b/gcc/testsuite/gcc.dg/torture/pr47383.c
new file mode 100644
index 0000000..ae8d670
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr47383.c
@@ -0,0 +1,30 @@
+/* { dg-do run } */
+
+static int heap[2*(256 +1+29)+1];
+static int heap_len;
+static int heap_max;
+void
+__attribute__ ((noinline))
+foo (int elems)
+{
+ int n, m;
+ int max_code = -1;
+ int node = elems;
+ heap_len = 0, heap_max = (2*(256 +1+29)+1);
+ for (n = 0; n < elems; n++)
+ heap[++heap_len] = max_code = n;
+ do {
+ n = heap[1];
+ heap[1] = heap[heap_len--];
+ m = heap[1];
+ heap[--heap_max] = n;
+ heap[--heap_max] = m;
+ } while (heap_len >= 2);
+}
+
+int
+main ()
+{
+ foo (286);
+ return 0;
+}