+2020-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/94114
+ * tree-loop-distribution.c (generate_memset_builtin): Call
+ rewrite_to_non_trapping_overflow even on mem.
+ (generate_memcpy_builtin): Call rewrite_to_non_trapping_overflow even
+ on dest and src.
+
2020-03-10 Jeff Law <law@redhat.com>
* config/bfin/bfin.md (movsi_insv): Add length attribute.
+2020-03-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/94114
+ * gcc.dg/pr94114.c: New test.
+
2020-03-10 Marek Polacek <polacek@redhat.com>
PR c++/94124 - wrong conversion error with non-viable overload.
--- /dev/null
+/* PR tree-optimization/94114 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-distribute-patterns -ftrapv" } */
+
+void
+foo (int *x, int *y, int *z, long int w)
+{
+ while (y + w > z)
+ {
+ x[w] = 0;
+ --w;
+ }
+}
nb_bytes = rewrite_to_non_trapping_overflow (builtin->size);
nb_bytes = force_gimple_operand_gsi (&gsi, nb_bytes, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
- mem = builtin->dst_base;
+ mem = rewrite_to_non_trapping_overflow (builtin->dst_base);
mem = force_gimple_operand_gsi (&gsi, mem, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
nb_bytes = rewrite_to_non_trapping_overflow (builtin->size);
nb_bytes = force_gimple_operand_gsi (&gsi, nb_bytes, true, NULL_TREE,
false, GSI_CONTINUE_LINKING);
- dest = builtin->dst_base;
- src = builtin->src_base;
+ dest = rewrite_to_non_trapping_overflow (builtin->dst_base);
+ src = rewrite_to_non_trapping_overflow (builtin->src_base);
if (partition->kind == PKIND_MEMCPY
|| ! ptr_derefs_may_alias_p (dest, src))
kind = BUILT_IN_MEMCPY;