From d964ba07c74523684f25cc9f4860ea2f8dba2513 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 16 Nov 2016 12:55:02 +0000 Subject: [PATCH] re PR middle-end/78333 (always-inline gnu-inline functions break -finstrument-functions) 2016-11-16 Richard Biener PR middle-end/78333 * gimplify.c (gimplify_function_tree): Do not instrument GNU extern inline functions. * gcc.dg/pr78333.c: New testcase. From-SVN: r242487 --- gcc/ChangeLog | 6 ++++++ gcc/gimplify.c | 4 ++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr78333.c | 9 +++++++++ 4 files changed, 24 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr78333.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08f0a7c99ec..a49e0249236 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-11-16 Richard Biener + + PR middle-end/78333 + * gimplify.c (gimplify_function_tree): Do not instrument + GNU extern inline functions. + 2016-11-16 Martin Liska PR sanitizer/78270 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c23888b4624..8611060aea6 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -12547,6 +12547,10 @@ gimplify_function_tree (tree fndecl) /* ??? Add some way to ignore exceptions for this TFE. */ if (flag_instrument_function_entry_exit && !DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (fndecl) + /* Do not instrument extern inline functions. */ + && !(DECL_DECLARED_INLINE_P (fndecl) + && DECL_EXTERNAL (fndecl) + && DECL_DISREGARD_INLINE_LIMITS (fndecl)) && !flag_instrument_functions_exclude_p (fndecl)) { tree x; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b964464152e..59a707f0dbc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-11-16 Richard Biener + + PR middle-end/78333 + * gcc.dg/pr78333.c: New testcase. + 2016-11-16 Martin Liska PR sanitizer/78270 diff --git a/gcc/testsuite/gcc.dg/pr78333.c b/gcc/testsuite/gcc.dg/pr78333.c new file mode 100644 index 00000000000..fd3669ce925 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr78333.c @@ -0,0 +1,9 @@ +/* { dg-do link } */ +/* { dg-options "-finstrument-functions" } */ + +extern inline __attribute__((gnu_inline, always_inline)) int foo () { } +int main() +{ + foo (); + return 0; +} -- 2.30.2