From b2953ba0cb7deb9202c6be5ecbbb9d078cede900 Mon Sep 17 00:00:00 2001 From: Ilya Enkovich Date: Wed, 25 Mar 2015 12:41:27 +0000 Subject: [PATCH] re PR target/65508 (ICE: in initialize_inlined_parameters, at tree-inline.c:3305 with -fcheck-pointer-bounds -mmpx and nested function) gcc/ PR target/65508 * tree-chkp.c (chkp_add_bounds_to_call_stmt): Set static chain for generated call. gcc/testsuite/ PR target/65508 * gcc.target/i386/mpx/pr65508.c: New. From-SVN: r221661 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/mpx/pr65508.c | 12 ++++++++++++ gcc/tree-chkp.c | 1 + 4 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/mpx/pr65508.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4c8aff8cb2..fbef8a1f7e1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-03-25 Ilya Enkovich + + PR target/65508 + * tree-chkp.c (chkp_add_bounds_to_call_stmt): Set static + chain for generated call. + 2015-03-25 Richard Biener * passes.c (pass_manager::execute_early_local_passes): Guard diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cf3b288b064..f92db23395c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-25 Ilya Enkovich + + PR target/65508 + * gcc.target/i386/mpx/pr65508.c: New. + 2015-03-25 Mikael Morin PR fortran/64952 diff --git a/gcc/testsuite/gcc.target/i386/mpx/pr65508.c b/gcc/testsuite/gcc.target/i386/mpx/pr65508.c new file mode 100644 index 00000000000..9060287cac5 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/mpx/pr65508.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fcheck-pointer-bounds -mmpx" } */ + +void +bar (int N) +{ + int a[N]; + void foo (int a[N]) + { + } + foo (a); +} diff --git a/gcc/tree-chkp.c b/gcc/tree-chkp.c index 977c460b60f..03f75b35da8 100644 --- a/gcc/tree-chkp.c +++ b/gcc/tree-chkp.c @@ -1838,6 +1838,7 @@ chkp_add_bounds_to_call_stmt (gimple_stmt_iterator *gsi) new_call = gimple_build_call_vec (gimple_op (call, 1), new_args); gimple_call_set_lhs (new_call, gimple_call_lhs (call)); gimple_call_copy_flags (new_call, call); + gimple_call_set_chain (new_call, gimple_call_chain (call)); } new_args.release (); -- 2.30.2