Commit 8dc19053 by Martin Liska Committed by Martin Liska

Get bounds for a PARM_DECL (PR ipa/79761).

2017-03-09  Martin Liska  <mliska@suse.cz>

	PR ipa/79761
	* tree-chkp.c (chkp_get_bound_for_parm): Get bounds for a param.
	(chkp_find_bounds_1): Remove gcc_unreachable.
2017-03-09  Martin Liska  <mliska@suse.cz>

	PR ipa/79761
	* g++.dg/pr79761.C: New test.

From-SVN: r245993
parent bba81f1c
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79761
* tree-chkp.c (chkp_get_bound_for_parm): Get bounds for a param.
(chkp_find_bounds_1): Remove gcc_unreachable.
2017-03-09 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79944
......
2017-03-09 Martin Liska <mliska@suse.cz>
PR ipa/79761
* g++.dg/pr79761.C: New test.
2017-03-09 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/79944
......
/* { dg-do compile { target { { i?86-*-* x86_64-*-* } && { ! x32 } } } } */
/* { dg-options "-fcheck-pointer-bounds -mmpx -mabi=ms" } */
struct Foo
{
Foo() : a(1), b(1), c('a') {}
int a;
int b;
char c;
};
static Foo copy_foo(Foo) __attribute__((noinline, noclone));
static Foo copy_foo(Foo A)
{
return A;
}
struct Bar : Foo
{
Bar(Foo t) : Foo(copy_foo(t)) {}
};
Foo F;
int main (void)
{
Bar B (F);
if (B.a != 1 || B.b != 1 || B.c != 'a')
__builtin_abort ();
return 0;
}
......@@ -3604,8 +3604,8 @@ chkp_find_bounds_1 (tree ptr, tree ptr_src, gimple_stmt_iterator *iter)
break;
case PARM_DECL:
gcc_unreachable ();
bounds = chkp_get_bound_for_parm (ptr_src);
/* Handled above but failed. */
bounds = chkp_get_invalid_op_bounds ();
break;
case TARGET_MEM_REF:
......
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