History

perf tools: Remove broken __no_tail_call attribute

The GCC specific __attribute__((optimize)) attribute does not what is commonly expected and is explicitly recommended against using in production code by the GCC people. Unlike what is often expected, it doesn't add to the optimization flags, but it fully replaces them, loosing any and all optimization flags provided by the compiler commandline. The only guaranteed upon means of inhibiting tail-calls is by placing a volatile asm with side-effects after the call such that the tail-call simply cannot be done. Given the original commit wasn't specific on which calls were the problem, this removal might re-introduce the problem, which can then be re-analyzed and cured properly.

Peter Zijlstra committed 6 years ago

Commit 9ae1e991 parent 0dfbe4c3 files · +5 −20Browse files

Showing the changes to tools/include/linux (2 of 3 files). Show all

Unified · Split

2 files
  1. tools/include/linux/compiler-gcc.h +0 −12
  2. tools/include/linux/compiler.h +0 −3
tools/include/linux/compiler-gcc.h+0−12
@@ -27,18 +27,6 @@ · 26 unmodified lines
2727 #define __pure __attribute__((pure))
2828 #endif
2929 #define noinline __attribute__((noinline))
30−#ifdef __has_attribute
31−#if __has_attribute(disable_tail_calls)
32−#define __no_tail_call __attribute__((disable_tail_calls))
33−#endif
34−#endif
35−#ifndef __no_tail_call
36−#if GCC_VERSION > 40201
37−#define __no_tail_call __attribute__((optimize("no-optimize-sibling-calls")))
38−#else
39−#define __no_tail_call
40−#endif
41−#endif
4230 #ifndef __packed
4331 #define __packed __attribute__((packed))
4432 #endif
tools/include/linux/compiler.h+0−3
@@ -47,9 +47,6 @@ · 46 unmodified lines
4747 #ifndef noinline
4848 #define noinline
4949 #endif
50−#ifndef __no_tail_call
51−#define __no_tail_call
52−#endif
5350
5451 /* Are two types/vars the same type (ignoring qualifiers)? */
5552 #ifndef __same_type

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t