summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch58
1 files changed, 0 insertions, 58 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
deleted file mode 100644
index 603a29afec..0000000000
--- a/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 8c014bceeca6a558519e86b16a8142accc41e94f Mon Sep 17 00:00:00 2001
2From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
3Date: Thu, 28 Jun 2018 00:25:21 +0000
4Subject: [PATCH] PR c++/80290 - memory-hog with std::pair.
5
6 * pt.c (type_unification_real): Skip non-dependent conversion
7 check for a nested list argument.
8 (braced_init_depth): New.
9
10Upstream-Status: Backport
11Signed-off-by: Joel Stanley <joel@jms.id.au>
12---
13 gcc/cp/pt.c | 22 ++++++++++++++++++++++
14 1 file changed, 22 insertions(+)
15
16diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
17index 79cfd0129226..71077a3b0498 100644
18--- a/gcc/cp/pt.c
19+++ b/gcc/cp/pt.c
20@@ -19242,6 +19242,24 @@ try_array_deduction (tree tparms, tree targs, tree parm)
21 /*nondeduced*/false, array_deduction_r);
22 }
23
24+/* Returns how many levels of { } INIT contains. */
25+
26+static int
27+braced_init_depth (tree init)
28+{
29+ if (!init || !BRACE_ENCLOSED_INITIALIZER_P (init))
30+ return 0;
31+ unsigned i; tree val;
32+ unsigned max = 0;
33+ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, val)
34+ {
35+ unsigned elt_d = braced_init_depth (val);
36+ if (elt_d > max)
37+ max = elt_d;
38+ }
39+ return max + 1;
40+}
41+
42 /* Most parms like fn_type_unification.
43
44 If SUBR is 1, we're being called recursively (to unify the
45@@ -19478,6 +19496,10 @@ type_unification_real (tree tparms,
46
47 if (uses_template_parms (parm))
48 continue;
49+ /* Workaround for c++/80290: avoid combinatorial explosion on
50+ deeply nested braced init-lists. */
51+ if (braced_init_depth (arg) > 2)
52+ continue;
53 if (check_non_deducible_conversion (parm, arg, strict, flags,
54 explain_p))
55 return 1;
56--
572.17.1
58