From: Dale Johannesen <dalej@apple.com>
To: Andrew Haley <aph@redhat.com>
Cc: gcc@gcc.gnu.org, Dave Korn <dk@artimi.com>,
Dale Johannesen <dalej@apple.com>,
"'Nathan Sidwell'" <nathan@codesourcery.com>
Subject: Re: warning: right shift count >= width of type
Date: Mon, 29 Nov 2004 19:17:00 -0000 [thread overview]
Message-ID: <7B08DB42-4238-11D9-BDCE-000A95D7CD40@apple.com> (raw)
In-Reply-To: <16811.28586.88479.416765@cuddles.cambridge.redhat.com>
On Nov 29, 2004, at 10:51 AM, Andrew Haley wrote:
>> I myself would want "(n >> 32)" to produce the same result as "((n
>> >> 16)
>>>> 16)" and indeed "for (int i = 32; i > 0; i--, n >>= 1) ;", and it
>>>> seems
>> to be generally agreed that the compiler would be at liberty to so do
>> if it
>> wants to.
>
> But you could never depend on it. If it only works when the shift
> count is a constant, a failure to do constant folding would break it.
Or constant propagation, or inlining, or ...
next prev parent reply other threads:[~2004-11-29 18:57 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-29 16:30 Dave Korn
2004-11-29 16:33 ` Nathan Sidwell
2004-11-29 17:01 ` Andrew Haley
2004-11-29 17:12 ` Dale Johannesen
2004-11-29 17:14 ` Dave Korn
2004-11-29 17:26 ` Andrew Haley
2004-11-29 18:29 ` Peter Barada
2004-11-29 18:53 ` Dave Korn
2004-11-29 18:52 ` Dave Korn
2004-11-29 19:09 ` Andrew Haley
2004-11-29 19:17 ` Dale Johannesen [this message]
2004-11-29 19:54 ` Dave Korn
2004-11-29 17:38 ` Chris Jefferson
2004-11-29 18:46 ` Dave Korn
2004-11-29 19:19 ` Chris Jefferson
2004-11-29 19:46 ` Dave Korn
2004-11-29 23:49 Paul Schlie
2004-11-30 1:50 ` Andreas Schwab
2004-11-30 4:23 Paul Schlie
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=7B08DB42-4238-11D9-BDCE-000A95D7CD40@apple.com \
--to=dalej@apple.com \
--cc=aph@redhat.com \
--cc=dk@artimi.com \
--cc=gcc@gcc.gnu.org \
--cc=nathan@codesourcery.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).