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.
Showing the changes to tools/include/linux (2 of 3 files). Show all
Unified · Split
| @@ -27,18 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | #define __pure __attribute__((pure)) |
| 28 | 28 | #endif |
| 29 | 29 | #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 | |
| 42 | 30 | #ifndef __packed |
| 43 | 31 | #define __packed __attribute__((packed)) |
| 44 | 32 | #endif |
| @@ -47,9 +47,6 @@ · 46 unmodified lines | ||
| 47 | 47 | #ifndef noinline |
| 48 | 48 | #define noinline |
| 49 | 49 | #endif |
| 50 | −#ifndef __no_tail_call | |
| 51 | −#define __no_tail_call | |
| 52 | −#endif | |
| 53 | 50 | |
| 54 | 51 | /* Are two types/vars the same type (ignoring qualifiers)? */ |
| 55 | 52 | #ifndef __same_type |