On Thu, Dec 08, 2022 at 08:25:26AM +0100, Florian Weimer wrote: > * Marek Polacek via Gcc-patches: > > > diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi > > index 726392409b6..2de14466dd3 100644 > > --- a/gcc/doc/invoke.texi > > +++ b/gcc/doc/invoke.texi > > @@ -16510,6 +16510,14 @@ The option cannot be combined with > > @option{-fsanitize=thread} or > > @option{-fsanitize=hwaddress}. Note that the only target > > @option{-fsanitize=hwaddress} is currently supported on is AArch64. > > > > +To get more accurate stack traces, it is possible to use options such as > > +@option{-O} (which, for instance, prevents most function inlining), > > +@option{-fno-optimize-sibling-calls} (which prevents optimizing sibling > > +and tail recursive calls), or @option{-fno-ipa-icf} (which disables > > Identical > > +Code Folding for functions and read-only variables). Since multiple runs > > +of the program may yield backtraces with different addresses due to ASLR, > > +it may be desirable to turn off ASLR: @samp{setarch `uname -m` -R ./prog}. > > What about -fasynchronous-unwind-tables? It should help if ASAN ever > reports stray segmentation faults. Whether it also helps in general > depends on whether ASAN maintains ABI around its instrumentation.
I'm not sure. Someone else will have to decide if we want to mention that option as well. Marek