public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Schlie <schlie@comcast.net>
To: Giovanni Bajo <rasky@develer.com>, Diego Novillo <dnovillo@redhat.com>
Cc: <gcc@gcc.gnu.org>
Subject: Re: potential simple loop optimization assistance strategy?
Date: Fri, 01 Jul 2005 19:42:00 -0000	[thread overview]
Message-ID: <BEEB14CC.AB24%schlie@comcast.net> (raw)
In-Reply-To: <02fe01c57e6a$4f907eb0$bf03030a@trilan>

> From: Giovanni Bajo <rasky@develer.com>
>> Diego Novillo <dnovillo@redhat.com> wrote:
>>> There has been some opposition in the past about allowing conditions in
>>> asserts to be used as hints to the optimizers. In fact, I would like to
>>> know if there is a current statement of purpose about this. That is,
> would
>>> there be strong oppositions to patches doing this?
>>> 
>> VRP naturally takes advantage of assert (though not in some
>> occassions involving unsigned types).  Try:
>> 
>> #include <assert.h>
>> 
>> foo (int i)
>> {
>>   assert (i != 0);
>>   if (i == 0)
>>     return 3;
>> 
>>   return 2;
>> }
> 
> Agreed, but my point is whether we can do that when NDEBUG is defined.

Might be nice to have both flavors, or take a parameter which indicates
if it's meant to be a static assertion, or throw a named runtime exception;
where the static assertion inhibit code generation simply inhibits code
generation somehow? as their requirement is not mutually exclusive.




  reply	other threads:[~2005-07-01 19:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-01 15:51 Paul Schlie
2005-07-01 16:24 ` Gabriel Dos Reis
2005-07-01 17:15   ` Paul Schlie
2005-07-01 16:27 ` Devang Patel
2005-07-01 18:16 ` Giovanni Bajo
2005-07-01 18:22   ` Diego Novillo
2005-07-01 18:26     ` Giovanni Bajo
2005-07-01 19:42       ` Paul Schlie [this message]
     [not found]       ` <m3k6ka6po1.fsf@localhost.localdomain>
2005-07-02  9:18         ` Giovanni Bajo
2005-07-02 15:39           ` Michael Veksler
2005-07-02 18:58             ` Giovanni Bajo

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=BEEB14CC.AB24%schlie@comcast.net \
    --to=schlie@comcast.net \
    --cc=dnovillo@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=rasky@develer.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).