diff options
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.3.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch | 58 |
2 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc b/meta/recipes-devtools/gcc/gcc-7.3.inc index 81320dc52a..c7c88f12e4 100644 --- a/meta/recipes-devtools/gcc/gcc-7.3.inc +++ b/meta/recipes-devtools/gcc/gcc-7.3.inc | |||
| @@ -80,6 +80,7 @@ BACKPORTS = "\ | |||
| 80 | file://0001-Fix-internal-compiler-error-in-testcase.patch \ | 80 | file://0001-Fix-internal-compiler-error-in-testcase.patch \ |
| 81 | file://0001-PR-rtl-optimization-83030.patch \ | 81 | file://0001-PR-rtl-optimization-83030.patch \ |
| 82 | file://0001-Fix-ppc64le-build-Partial-backport-r256656.patch \ | 82 | file://0001-Fix-ppc64le-build-Partial-backport-r256656.patch \ |
| 83 | file://0001-PR-c-80290-memory-hog-with-std-pair.patch \ | ||
| 83 | " | 84 | " |
| 84 | 85 | ||
| 85 | SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2" | 86 | SRC_URI[md5sum] = "be2da21680f27624f3a87055c4ba5af2" |
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 new file mode 100644 index 0000000000..603a29afec --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | From 8c014bceeca6a558519e86b16a8142accc41e94f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
| 3 | Date: Thu, 28 Jun 2018 00:25:21 +0000 | ||
| 4 | Subject: [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 | |||
| 10 | Upstream-Status: Backport | ||
| 11 | Signed-off-by: Joel Stanley <joel@jms.id.au> | ||
| 12 | --- | ||
| 13 | gcc/cp/pt.c | 22 ++++++++++++++++++++++ | ||
| 14 | 1 file changed, 22 insertions(+) | ||
| 15 | |||
| 16 | diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c | ||
| 17 | index 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 | -- | ||
| 57 | 2.17.1 | ||
| 58 | |||
