+2020-03-18 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/94206
+ * gimple-fold.c (gimple_fold_builtin_memset): Avoid using
+ partial int modes or not mode-precision integer types for
+ the store.
+
2020-03-18 Jakub Jelinek <jakub@redhat.com>
* asan.c (get_mem_refs_of_builtin_call): Fix up duplicated word issue
length = tree_to_uhwi (len);
if (GET_MODE_SIZE (SCALAR_INT_TYPE_MODE (etype)) != length
+ || (GET_MODE_PRECISION (SCALAR_INT_TYPE_MODE (etype))
+ != GET_MODE_BITSIZE (SCALAR_INT_TYPE_MODE (etype)))
|| get_pointer_alignment (dest) / BITS_PER_UNIT < length)
return NULL_TREE;
if (length > HOST_BITS_PER_WIDE_INT / BITS_PER_UNIT)
return NULL_TREE;
+ if (!type_has_mode_precision_p (etype))
+ etype = lang_hooks.types.type_for_mode (SCALAR_INT_TYPE_MODE (etype),
+ TYPE_UNSIGNED (etype));
+
if (integer_zerop (c))
cval = 0;
else
+2020-03-18 Richard Biener <rguenther@suse.de>
+
+ PR middle-end/94206
+ * gcc.dg/torture/pr94206.c: New testcase.
+
2020-03-18 Duan bo <duanbo3@huawei.com>
PR target/94201
--- /dev/null
+/* { dg-do run { target lp64 } } */
+
+struct {
+ unsigned long x:33;
+} s;
+typedef __typeof__(s.x + 0) uint33;
+
+int main()
+{
+ uint33 x;
+ __builtin_memset(&x, -1, sizeof x);
+ unsigned long u;
+ __builtin_memcpy(&u, &x, sizeof u);
+ if (u != -1ul)
+ __builtin_abort ();
+ return 0;
+}