I'd made it a precondition of vector_builder::elt that the encoding
must have been fully populated and that all implicit elements are
therefore defined. But for one of the AArch64 patches I'm working on,
it'd be convenient to be able to look back at previous elements while
building up the encoding. This patch therefore makes the assert
specific to implicit elements only.
2019-07-12 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* vector-builder.h (vector_builder::elt): Allow already-supplied
elements to be read back before building is complete.
From-SVN: r273440
+2019-07-12 Richard Sandiford <richard.sandiford@arm.com>
+
+ * vector-builder.h (vector_builder::elt): Allow already-supplied
+ elements to be read back before building is complete.
+
2019-07-12 Eric Botcazou <ebotcazou@adacore.com>
PR rtl-optimization/91136
T
vector_builder<T, Derived>::elt (unsigned int i) const
{
- /* This only makes sense if the encoding has been fully populated. */
- gcc_checking_assert (encoded_nelts () <= this->length ());
-
/* First handle elements that are already present in the underlying
vector, regardless of whether they're part of the encoding or not. */
if (i < this->length ())
return (*this)[i];
+ /* Extrapolation is only possible if the encoding has been fully
+ populated. */
+ gcc_checking_assert (encoded_nelts () <= this->length ());
+
/* Identify the pattern that contains element I and work out the index of
the last encoded element for that pattern. */
unsigned int pattern = i % m_npatterns;