Commit 63831879 by Martin Jambor Committed by Martin Jambor

[PR 88214] Check that an argument is a pointer

2018-12-10  Martin Jambor  <mjambor@suse.cz>

	PR ipa/88214
	* ipa-prop.c (determine_locally_known_aggregate_parts): Make sure
	we check pointers against pointers.

	testsuite/
	* gcc.dg/ipa/pr88214.c: New test.

From-SVN: r266953
parent f4737625
2018-12-10 Martin Jambor <mjambor@suse.cz>
PR ipa/88214
* ipa-prop.c (determine_locally_known_aggregate_parts): Make sure
we check pointers against pointers.
2018-12-10 Richard Biener <rguenther@suse.de> 2018-12-10 Richard Biener <rguenther@suse.de>
PR middle-end/88415 PR middle-end/88415
...@@ -1569,7 +1569,8 @@ determine_locally_known_aggregate_parts (gcall *call, tree arg, ...@@ -1569,7 +1569,8 @@ determine_locally_known_aggregate_parts (gcall *call, tree arg,
if (TREE_CODE (arg) == SSA_NAME) if (TREE_CODE (arg) == SSA_NAME)
{ {
tree type_size; tree type_size;
if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type)))) if (!tree_fits_uhwi_p (TYPE_SIZE (TREE_TYPE (arg_type)))
|| !POINTER_TYPE_P (TREE_TYPE (arg)))
return; return;
check_ref = true; check_ref = true;
arg_base = arg; arg_base = arg;
......
2018-12-10 Martin Jambor <mjambor@suse.cz>
PR ipa/88214
* gcc.dg/ipa/pr88214.c: New test.
2018-12-10 Jakub Jelinek <jakub@redhat.com> 2018-12-10 Jakub Jelinek <jakub@redhat.com>
PR testsuite/88369 PR testsuite/88369
......
/* { dg-do compile } */
/* { dg-options "-O2" } */
void i();
short a;
void b(e) char * e;
{
i();
b(a);
}
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