re PR middle-end/78333 (always-inline gnu-inline functions break -finstrument-functions)

2016-11-16  Richard Biener  <rguenther@suse.de>

	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
This commit is contained in:
Richard Biener 2016-11-16 12:55:02 +00:00 committed by Richard Biener
parent 080140bc85
commit d964ba07c7
4 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2016-11-16 Richard Biener <rguenther@suse.de>
PR middle-end/78333
* gimplify.c (gimplify_function_tree): Do not instrument
GNU extern inline functions.
2016-11-16 Martin Liska <mliska@suse.cz>
PR sanitizer/78270

View File

@ -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;

View File

@ -1,3 +1,8 @@
2016-11-16 Richard Biener <rguenther@suse.de>
PR middle-end/78333
* gcc.dg/pr78333.c: New testcase.
2016-11-16 Martin Liska <mliska@suse.cz>
PR sanitizer/78270

View File

@ -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;
}