From: Jeff Law <law@redhat.com>
To: Andi Kleen <andi@firstfloor.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
GCC Patches <gcc-patches@gcc.gnu.org>,
Uros Bizjak <ubizjak@gmail.com>
Subject: Re: Turn on -fomit-frame-pointer by default for 32bit x86?
Date: Fri, 16 Jul 2010 19:43:00 -0000 [thread overview]
Message-ID: <4C40B668.8010803@redhat.com> (raw)
In-Reply-To: <87sk3jkyni.fsf@basil.nowhere.org>
On 07/16/10 13:35, Andi Kleen wrote:
> "H.J. Lu"<hjl.tools@gmail.com> writes:
>
>
>> [hjl@gnu-6 tmp]$ /usr/gcc-4.5/bin/gcc -m32 -S x.c -O3
>> [hjl@gnu-6 tmp]$ cat x.s
>> .file "x.c"
>> .text
>> .globl foo
>> .type foo, @function
>> foo:
>> pushl %ebp
>> movl %esp, %ebp
>> popl %ebp
>> ret
>>
>> Can we turn on -fomit-frame-pointer by default for 32bit?
>>
> I think it's a good idea, but in general one side effect one should
> be aware of is that it breaks many profilers with calltrace per sample
> support. Those tend to not be able to read unwind tables.
>
Speaking of, I sent you a message on fentry about a month ago, but
didn't get a reply:
I was ready to commit, except that we get a few new testsuite failures
which I think touch on the issue of implicit setting of
-fomit-frame-pointer issue.
See:
/* Set the default values for switches whose default depends on
TARGET_64BIT
in case they weren't overwritten by command line options. */
if (TARGET_64BIT)
{
/* Mach-O doesn't support omitting the frame pointer for now. */
if (flag_omit_frame_pointer == 2)
flag_omit_frame_pointer = (TARGET_MACHO ? 0 : 1);
if (flag_asynchronous_unwind_tables == 2)
flag_asynchronous_unwind_tables = 1;
if (flag_pcc_struct_return == 2)
flag_pcc_struct_return = 0;
}
else
{
if (flag_omit_frame_pointer == 2)
flag_omit_frame_pointer = 0;
if (flag_asynchronous_unwind_tables == 2)
flag_asynchronous_unwind_tables = 0;
if (flag_pcc_struct_return == 2)
flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
}
For x86_64, -fomit-frame-pointer is implicitly set; therefore with your
patch someone compiling with -O2 -pg will get a diagnostic informing
them those options are incompatible except with -mfentry is added. I
don't think you intended to get a diagnostic in this case. It's
certainly a behaviour change.
Jeff
prev parent reply other threads:[~2010-07-16 19:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-13 18:15 H.J. Lu
2010-07-13 20:40 ` Richard Guenther
2010-07-13 20:59 ` H.J. Lu
2010-07-13 21:02 ` Andrew Pinski
2010-07-13 21:03 ` Andrew Pinski
2010-07-13 21:44 ` H.J. Lu
2010-07-14 8:09 ` Richard Guenther
2010-07-14 13:47 ` H.J. Lu
2010-07-14 21:55 ` H.J. Lu
2010-07-14 12:00 ` Dave Korn
2010-07-16 19:35 ` Andi Kleen
2010-07-16 19:43 ` Jeff Law [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C40B668.8010803@redhat.com \
--to=law@redhat.com \
--cc=andi@firstfloor.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=hjl.tools@gmail.com \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).