From: Ilya Enkovich Date: Wed, 15 Jun 2016 15:49:40 +0000 (+0000) Subject: re PR middle-end/71529 ([CHKP] ICE in expand_expr_real_1) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=209d1e2d94c11f8407b53bc122115add9e050ecd;p=gcc.git re PR middle-end/71529 ([CHKP] ICE in expand_expr_real_1) gcc/ PR middle-end/71529 * ipa-chkp.c (chkp_build_instrumented_fndecl): Fix DECL_CONTEXT for copied arguments. gcc/testsuite/ PR middle-end/71529 * gcc.target/i386/pr71529.C: New test. From-SVN: r237484 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 88c1e0f253b..2aa82f5a47a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-15 Ilya Enkovich + + PR middle-end/71529 + * ipa-chkp.c (chkp_build_instrumented_fndecl): Fix + DECL_CONTEXT for copied arguments. + 2016-06-15 Alan Hayward PR tree-optimization/71483 diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index 5f5df6483a7..86c48f14f64 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -207,7 +207,13 @@ chkp_build_instrumented_fndecl (tree fndecl) /* For functions with body versioning will make a copy of arguments. For functions with no body we need to do it here. */ if (!gimple_has_body_p (fndecl)) - DECL_ARGUMENTS (new_decl) = copy_list (DECL_ARGUMENTS (fndecl)); + { + tree arg; + + DECL_ARGUMENTS (new_decl) = copy_list (DECL_ARGUMENTS (fndecl)); + for (arg = DECL_ARGUMENTS (new_decl); arg; arg = DECL_CHAIN (arg)) + DECL_CONTEXT (arg) = new_decl; + } /* We are going to modify attributes list and therefore should make own copy. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 60c3192c90b..dbd8df829b5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-15 Ilya Enkovich + + PR middle-end/71529 + * gcc.target/i386/pr71529.C: New test. + 2016-06-15 Alan Hayward PR tree-optimization/71483 diff --git a/gcc/testsuite/gcc.target/i386/pr71529.C b/gcc/testsuite/gcc.target/i386/pr71529.C new file mode 100644 index 00000000000..3169101e1a7 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr71529.C @@ -0,0 +1,22 @@ +/* PR71529 */ +/* { dg-do compile { target { ! x32 } } } */ +/* { dg-options "-fcheck-pointer-bounds -mmpx -O2" } */ + +class c1 +{ + public: + virtual ~c1 (); +}; + +class c2 +{ + public: + virtual ~c2 (); +}; + +class c3 : c1, c2 { }; + +int main (int, char **) +{ + c3 obj; +}