From: Richard Guenther <richard.guenther@gmail.com>
To: Bingfeng Mei <bmei@broadcom.com>
Cc: Andrew Haley <aph@redhat.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Release novops attribute for external use?
Date: Tue, 13 Apr 2010 09:56:00 -0000 [thread overview]
Message-ID: <r2t84fc9c001004130245ja897b182ne58cfe2ed103f517@mail.gmail.com> (raw)
In-Reply-To: <7FB04A5C213E9943A72EE127DB74F0ADA66512E906@SJEXCHCCR02.corp.ad.broadcom.com>
On Tue, Apr 13, 2010 at 10:55 AM, Bingfeng Mei <bmei@broadcom.com> wrote:
> Something like printf (Though I read somewhere glibc extension of printf
> make it non-pure).
Surely printf writes to global memory (it clobbers the stdout FILE*)
As for the original question - novops is internal only because its
semantics is purely internal and changes with internal aliasing
changes.
Now, we still lack a compelling example to see what exact semantics
you are requesting? I suppose it might be close to a pure but
volatile function? Which you could simulate by
dummy = pure_fn ();
asm ("" : "g" (dummy));
or even
volatile int dummy = pure_fn ();
Richard.
> Bingfeng
>
>> -----Original Message-----
>> From: gcc-owner@gcc.gnu.org [mailto:gcc-owner@gcc.gnu.org] On
>> Behalf Of Andrew Haley
>> Sent: 12 April 2010 17:34
>> To: gcc@gcc.gnu.org
>> Subject: Re: Release novops attribute for external use?
>>
>> On 04/12/2010 05:27 PM, Bingfeng Mei wrote:
>> > Hello,
>> > One of our engineers requested a feature so that
>> > compiler can avoid to re-load variables after a function
>> > call if it is known not to write to memory. It should
>> > slash considerable code size in our applications. I found
>> > the existing "pure" and "const" cannot meet his requirements
>> > because the function is optimized out if it doesn't return
>> > a value.
>>
>> If a function doesn't write to memory and it doesn't return a
>> value, what is the point of calling it?
>>
>> Andrew.
>>
>>
>
next prev parent reply other threads:[~2010-04-13 9:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 16:56 Bingfeng Mei
2010-04-12 16:58 ` Andrew Haley
2010-04-12 18:05 ` Dave Korn
2010-04-12 18:10 ` Andrew Haley
2010-04-12 18:29 ` Dave Korn
2010-04-12 20:53 ` Daniel Jacobowitz
2010-04-13 9:45 ` Bingfeng Mei
2010-04-13 9:56 ` Richard Guenther [this message]
2010-04-13 10:15 ` Andrew Haley
2010-04-13 10:23 ` Bingfeng Mei
2010-04-13 10:25 ` Richard Guenther
2010-04-13 10:57 ` Richard Guenther
2010-04-13 11:35 ` Bingfeng Mei
2010-04-13 11:53 ` Manuel López-Ibáñez
2010-04-13 15:06 ` Richard Guenther
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=r2t84fc9c001004130245ja897b182ne58cfe2ed103f517@mail.gmail.com \
--to=richard.guenther@gmail.com \
--cc=aph@redhat.com \
--cc=bmei@broadcom.com \
--cc=gcc@gcc.gnu.org \
/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).