diff options
author | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
---|---|---|
committer | ToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp> | 2020-03-30 09:24:26 +0900 |
commit | 5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch) | |
tree | b4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch | |
parent | 706ad73eb02caf8532deaf5d38995bd258725cb8 (diff) |
agl-basesystem
Diffstat (limited to 'external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch')
-rw-r--r-- | external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch b/external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch new file mode 100644 index 00000000..603a29af --- /dev/null +++ b/external/poky/meta/recipes-devtools/gcc/gcc-7.3/0001-PR-c-80290-memory-hog-with-std-pair.patch @@ -0,0 +1,58 @@ +From 8c014bceeca6a558519e86b16a8142accc41e94f Mon Sep 17 00:00:00 2001 +From: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> +Date: Thu, 28 Jun 2018 00:25:21 +0000 +Subject: [PATCH] PR c++/80290 - memory-hog with std::pair. + + * pt.c (type_unification_real): Skip non-dependent conversion + check for a nested list argument. + (braced_init_depth): New. + +Upstream-Status: Backport +Signed-off-by: Joel Stanley <joel@jms.id.au> +--- + gcc/cp/pt.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c +index 79cfd0129226..71077a3b0498 100644 +--- a/gcc/cp/pt.c ++++ b/gcc/cp/pt.c +@@ -19242,6 +19242,24 @@ try_array_deduction (tree tparms, tree targs, tree parm) + /*nondeduced*/false, array_deduction_r); + } + ++/* Returns how many levels of { } INIT contains. */ ++ ++static int ++braced_init_depth (tree init) ++{ ++ if (!init || !BRACE_ENCLOSED_INITIALIZER_P (init)) ++ return 0; ++ unsigned i; tree val; ++ unsigned max = 0; ++ FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), i, val) ++ { ++ unsigned elt_d = braced_init_depth (val); ++ if (elt_d > max) ++ max = elt_d; ++ } ++ return max + 1; ++} ++ + /* Most parms like fn_type_unification. + + If SUBR is 1, we're being called recursively (to unify the +@@ -19478,6 +19496,10 @@ type_unification_real (tree tparms, + + if (uses_template_parms (parm)) + continue; ++ /* Workaround for c++/80290: avoid combinatorial explosion on ++ deeply nested braced init-lists. */ ++ if (braced_init_depth (arg) > 2) ++ continue; + if (check_non_deducible_conversion (parm, arg, strict, flags, + explain_p)) + return 1; +-- +2.17.1 + |