https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115995
--- Comment #1 from Monk Chiang <sh.chiang04 at gmail dot com> --- Another test, the compile option is "g++ -march=rv64gcv_zvl128b -mabi=lp64d -O3" #include <numeric> #include <vector> #include <iterator> using namespace std; int main () { std::vector<int> data = {2, 2, 2, 2, 2, 2}; std::vector<int> result (6, int(-1)); std::vector<int>::iterator start = data.begin(); std::vector<int>::iterator end = data.end(); std::vector<int>::iterator result_start = result.begin(); std::adjacent_difference(start, end, result_start); if (result[4] == 0) exit (0); else abort (); } After do adjacent_difference the result[] value should be [2, 0, 0, 0, 0, 0]