Commit 3f27391f by Marek Polacek Committed by Marek Polacek

re PR middle-end/86202 (ICE in get_range_info calling an invalid memcpy() declaration)

	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
parent 2831d681
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
......
......@@ -645,7 +645,7 @@ size_must_be_zero_p (tree size)
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
......
/* 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" } */
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment