From: Florian Weimer Date: Fri, 21 Sep 2018 19:49:36 +0000 (+0200) Subject: Document that attribute noreturn inhibits tail call optimization X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2e3f6531bfb5a880d88ec592de944a329aaef18a;p=gcc.git Document that attribute noreturn inhibits tail call optimization PR middle-end/81035 * doc/extend.texi (Common Function Attributes): Mention that noreturn suppresses tail call optimization. From-SVN: r264490 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 667ecca4ed0..3129eae5c2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-09-21 Florian Weimer + + PR middle-end/81035 + * doc/extend.texi (Common Function Attributes): Mention that + noreturn suppresses tail call optimization. + 2018-09-21 David Malcolm PR tree-optimization/87309 diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 4b606c007d8..7a696556c35 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -3157,6 +3157,9 @@ The @code{noreturn} keyword does not affect the exceptional path when that applies: a @code{noreturn}-marked function may still return to the caller by throwing an exception or calling @code{longjmp}. +In order to preserve backtraces, GCC will never turn calls to +@code{noreturn} functions into tail calls. + Do not assume that registers saved by the calling function are restored before calling the @code{noreturn} function.