diff options
author | Richard Henderson <rth@redhat.com> | 2016-03-16 09:50:18 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2016-03-16 09:50:18 -0700 |
commit | aa43616c59fceefa8ad06bfd60e88f17ad31f063 (patch) | |
tree | f650bc6e08ced3e2299e88208f3fcabd0e84f968 /gcc/ipa-chkp.c | |
parent | 59608fe587074a6f704d39fd08b6a05f6fb11bf2 (diff) | |
download | gcc-aa43616c59fceefa8ad06bfd60e88f17ad31f063.zip gcc-aa43616c59fceefa8ad06bfd60e88f17ad31f063.tar.gz gcc-aa43616c59fceefa8ad06bfd60e88f17ad31f063.tar.bz2 |
re PR middle-end/70199 (Crash at -O2 when using labels.)
PR middle-end/70199
* function.h (struct function): Add has_forced_label_in_static.
* gimplify.c (force_labels_r): Set it.
* lto-streamer-in.c (input_struct_function_base): Read it.
* lto-streamer-out.c (output_struct_function_base): Write it.
* tree-inline.c (has_label_address_in_static_1): Remove.
(copy_forbidden): Remove fndecl parameter; test
has_forced_label_in_static.
(inline_forbidden_p): Update call to copy_forbidden.
(tree_versionable_function_p): Likewise.
* ipa-chkp.c (chkp_instrumentable_p): Likewise.
(chkp_versioning): Likewise.
* tree-inline.h (copy_forbidden): Update decl.
testsuite/
* gcc.c-torture/compile/pr70199.c: New.
From-SVN: r234261
Diffstat (limited to 'gcc/ipa-chkp.c')
-rw-r--r-- | gcc/ipa-chkp.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/gcc/ipa-chkp.c b/gcc/ipa-chkp.c index 4a6b43e..5f5df64 100644 --- a/gcc/ipa-chkp.c +++ b/gcc/ipa-chkp.c @@ -470,7 +470,7 @@ chkp_instrumentable_p (tree fndecl) return (!lookup_attribute ("bnd_legacy", DECL_ATTRIBUTES (fndecl)) && (!flag_chkp_instrument_marked_only || lookup_attribute ("bnd_instrument", DECL_ATTRIBUTES (fndecl))) - && (!fn || !copy_forbidden (fn, fndecl))); + && (!fn || !copy_forbidden (fn))); } /* Return clone created for instrumentation of NODE or NULL. */ @@ -644,22 +644,22 @@ chkp_versioning (void) FOR_EACH_DEFINED_FUNCTION (node) { + tree decl = node->decl; if (!node->instrumentation_clone && !node->instrumented_version && !node->alias && !node->thunk.thunk_p - && (!DECL_BUILT_IN (node->decl) - || (DECL_BUILT_IN_CLASS (node->decl) == BUILT_IN_NORMAL - && DECL_FUNCTION_CODE (node->decl) < BEGIN_CHKP_BUILTINS))) + && (!DECL_BUILT_IN (decl) + || (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL + && DECL_FUNCTION_CODE (decl) < BEGIN_CHKP_BUILTINS))) { - if (chkp_instrumentable_p (node->decl)) - chkp_maybe_create_clone (node->decl); - else if ((reason = copy_forbidden (DECL_STRUCT_FUNCTION (node->decl), - node->decl))) + if (chkp_instrumentable_p (decl)) + chkp_maybe_create_clone (decl); + else if ((reason = copy_forbidden (DECL_STRUCT_FUNCTION (decl)))) { - if (warning_at (DECL_SOURCE_LOCATION (node->decl), OPT_Wchkp, + if (warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wchkp, "function cannot be instrumented")) - inform (DECL_SOURCE_LOCATION (node->decl), reason, node->decl); + inform (DECL_SOURCE_LOCATION (decl), reason, decl); } } } |