aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtlanal.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2015-05-11 09:35:53 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2015-05-11 09:35:53 +0000
commitcb6f459119104ddbba18330d329ada209f9bdc25 (patch)
tree6d3db918d04de28fb93c948686fd0bd5c282dd5e /gcc/rtlanal.c
parent258619bb2d420f54a510569cee8e642835f86023 (diff)
downloadgcc-cb6f459119104ddbba18330d329ada209f9bdc25.zip
gcc-cb6f459119104ddbba18330d329ada209f9bdc25.tar.gz
gcc-cb6f459119104ddbba18330d329ada209f9bdc25.tar.bz2
re PR rtl-optimization/66076 (ICE: in vec_safe_grow, at vec.h:618 with -funroll-loops -mno-prefer-avx128 -march=bdver4)
gcc/ PR rtl-optimization/66076 * rtlanal.c (generic_subrtx_iterator <T>::add_single_to_queue): Don't grow the heap array if it is already big enough from a previous iteration. gcc/testsuite/ PR rtl-optimization/66076 * gcc.dg/torture/pr66076.c: New test. From-SVN: r222999
Diffstat (limited to 'gcc/rtlanal.c')
-rw-r--r--gcc/rtlanal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 00d9080..68d9931 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -104,7 +104,10 @@ generic_subrtx_iterator <T>::add_single_to_queue (array_type &array,
return base;
}
gcc_checking_assert (i == LOCAL_ELEMS);
- vec_safe_grow (array.heap, i + 1);
+ /* A previous iteration might also have moved from the stack to the
+ heap, in which case the heap array will already be big enough. */
+ if (vec_safe_length (array.heap) <= i)
+ vec_safe_grow (array.heap, i + 1);
base = array.heap->address ();
memcpy (base, array.stack, sizeof (array.stack));
base[LOCAL_ELEMS] = x;