ash: less hackish implementation of evaltreenr()
Defining a function alias with __attribute__ ((alias("evaltree"),__noreturn__)) is not that usual, and clang had a bug which made it misunderstand this construct. Switch to: ALWAYS_INLINE NORETURN evaltreenr() { evaltree(); unreachable(); } Older gcc's do not know unreachable(), on them we pay the price of having a few extra calls to abort(): function old new delta evalsubshell 151 156 +5 evalpipe 357 362 +5 argstr 1141 1144 +3 On newer gcc, code size does not change. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@ -45,6 +45,13 @@
|
||||
|
||||
#define UNUSED_PARAM __attribute__ ((__unused__))
|
||||
#define NORETURN __attribute__ ((__noreturn__))
|
||||
|
||||
#if __GNUC_PREREQ(4,5)
|
||||
# define bb_unreachable(altcode) __builtin_unreachable()
|
||||
#else
|
||||
# define bb_unreachable(altcode) altcode
|
||||
#endif
|
||||
|
||||
/* "The malloc attribute is used to tell the compiler that a function
|
||||
* may be treated as if any non-NULL pointer it returns cannot alias
|
||||
* any other pointer valid when the function returns. This will often
|
||||
|
Reference in New Issue
Block a user