This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Frame pointer, bug or feature? (x86)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Hendrik Greving <hendrik dot greving dot intel at gmail dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 18 Nov 2013 20:48:44 +0100
- Subject: Re: Frame pointer, bug or feature? (x86)
- Authentication-results: sourceware.org; auth=none
- References: <CANc4vhoN4_zvYsSCpa-kjZ3XBT1KMNbAkHNCy=ORrt=fihquwg at mail dot gmail dot com> <CA+=Sn1=pK13xk0xVCiJiPjHdX38KXU3V43T1TEpwXeUyMuNYvQ at mail dot gmail dot com> <CANc4vhqm0fajt9v540oGpfwta2d2G+aeTocvvxJBRkDDs6Ry7g at mail dot gmail dot com> <CA+=Sn1kVvCofmgqyS6BJYLW_nExcODqXxx8sk3keiyTEziJJcQ at mail dot gmail dot com> <CANc4vhoAyyXJM6514qzXdMXprPrR2Ut_2+9Kh-8mtH0W7KJe0Q at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 18, 2013 at 11:22:22AM -0800, Hendrik Greving wrote:
> Interesting, I just read up on it and I didn't know that. Thanks. Is
> it correct to say though that it is a missing optimization and
> frame_pointer_needed shouldn't evaluate to true?
Certainly not unconditionally. It depends on the size and in which scope
it is declared. If user meant to use a VLA and compiler optimizes it into
non-VLA, then it isn't deallocated at the end of it's scope, so if it e.g.
is very large or there are many of those, the optimization can break valid
programs (especially if it's scope isn't the function scope but some smaller
scope).
Jakub