PR middle-end/86202
* gimple-fold.c (size_must_be_zero_p): Check the type of the size.
* gcc.dg/Wint-conversion-2.c: New test.
From-SVN: r262344
+2018-07-03 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/86202
+ * gimple-fold.c (size_must_be_zero_p): Check the type of the size.
+
2018-07-03 Richard Biener <rguenther@suse.de>
PR ipa/86389
if (integer_zerop (size))
return true;
- if (TREE_CODE (size) != SSA_NAME)
+ if (TREE_CODE (size) != SSA_NAME || !INTEGRAL_TYPE_P (TREE_TYPE (size)))
return false;
wide_int min, max;
+2018-07-03 Marek Polacek <polacek@redhat.com>
+
+ PR middle-end/86202
+ * gcc.dg/Wint-conversion-2.c: New test.
+
2018-07-03 Richard Biener <rguenther@suse.de>
PR ipa/86389
--- /dev/null
+/* PR middle-end/86202 */
+/* { dg-do compile } */
+/* { dg-options "-Wint-conversion" } */
+
+void *memcpy (void *, void *, __SIZE_TYPE__ *);
+void *a, *b;
+void f (void)
+{
+ long unsigned int c = 0;
+ memcpy (a, b, c); /* { dg-warning "passing argument" } */
+}