Re: F37 proposal: Add -fno-omit-frame-pointer to default compilation flags (System-Wide Change proposal)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Theodore Papadopoulo wrote:
> gdb and similar tools are confused, notably because local variables are
> "optimsed out" (which I suspect is related to frame pointer).

It is not.

This is related to compiling with any optimization at all, and you 
definitely do not want production binaries compiled without optimization 
(with -O0), they would be extremely slow and large.

Local variables are allocated to registers for as long as they are needed, 
and then evicted (overwritten by other data that needs the register) when 
the compiler finds they are "dead", i.e., no longer referenced in the rest 
of the function. Only when no registers are left, the variables are 
"spilled" to the stack (which is the only place where the frame pointer 
makes a difference, and only in the way the variables are accessed, i.e., 
they can be accessed relative to %rfp rather than %rsp). And some variables 
can be optimized out entirely, e.g., by inlining them into the computation 
of some other variable.

If anything, enabling the frame pointer will make it *more* likely that 
variables get optimized out because there will be one fewer register to use 
to hold their contents.

        Kevin Kofler
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux