diff options
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 8c8e52a..2df7863 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -11610,9 +11610,8 @@ fold_ternary_loc (location_t loc, enum tree_code code, tree type, unsigned int nelts = VECTOR_CST_NELTS (arg0); auto_vec<tree, 32> elts (nelts); elts.quick_grow (nelts); - memcpy (&elts[0], VECTOR_CST_ELTS (arg0), - sizeof (tree) * nelts); - elts[k] = arg1; + for (unsigned int i = 0; i < VECTOR_CST_NELTS (arg0); ++i) + elts[i] = (i == k ? arg1 : VECTOR_CST_ELT (arg0, i)); return build_vector (type, elts); } } |