Skip to content

Commit e861541

Browse files
authored
Merge pull request #636 from visitorckw/preserve-none
Adopt preserve_none attribute for MUST_TAIL optimization
2 parents 0358490 + d8382ab commit e861541

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/common.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,11 @@ static inline uint8_t ilog2(uint32_t x)
191191
* even without optimizations enabled.
192192
*/
193193
#if defined(__has_attribute) && __has_attribute(musttail)
194+
#if __has_attribute(preserve_none)
195+
#define MUST_TAIL __attribute__((musttail)) __attribute__((preserve_none))
196+
#else
194197
#define MUST_TAIL __attribute__((musttail))
198+
#endif
195199
#else
196200
#define MUST_TAIL
197201
#endif

0 commit comments

Comments
 (0)