From c891154fad7db61b15121ca9b80efcf95d0ff291 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 9 Oct 2007 15:51:06 -0600 Subject: [PATCH] PR libstdc++/33485 continued. 2007-10-09 Wolfgang Bangerth PR libstdc++/33485 continued. * include/parallel/multiway_mergesort.h: Use __builtin_alloca. From-SVN: r129182 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/parallel/multiway_mergesort.h | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index a36232fbcbd..7b96f32b9ad 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2007-10-09 Wolfgang Bangerth + + PR libstdc++/33485 continued. + * include/parallel/multiway_mergesort.h: Use __builtin_alloca. + 2007-10-09 Zhou Drangon PR libstdc++/33682 diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h index 9cc04052f5e..c1a07dc0352 100644 --- a/libstdc++-v3/include/parallel/multiway_mergesort.h +++ b/libstdc++-v3/include/parallel/multiway_mergesort.h @@ -139,7 +139,8 @@ namespace __gnu_parallel num_samples = Settings::sort_mwms_oversampling * d->num_threads - 1; - difference_type es[num_samples + 2]; + difference_type* es = static_cast(__builtin_alloca(sizeof(difference_type) * (num_samples + 2))); + equally_split(sd->starts[d->iam + 1] - sd->starts[d->iam], num_samples + 1, es); for (difference_type i = 0; i < num_samples; i++)