public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
@ 2002-07-01 17:06 Simon Shapiro
0 siblings, 0 replies; 4+ messages in thread
From: Simon Shapiro @ 2002-07-01 17:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7139; it has been noted by GNATS.
From: Simon Shapiro <shimon@nomis-storage.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Simon Shapiro <shimon@nomis-storage.com>, mmitchel@gcc.gnu.org <mmitchel@gcc.gnu.org>, gcc-bugs@gcc.gnu.org <gcc-bugs@gcc.gnu.org>, gcc-prs@gcc.gnu.org <gcc-prs@gcc.gnu.org>, nobody@gcc.gnu.org <nobody@gcc.gnu.org>, shimon@simon-shapiro.com <shSubject: Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
Date: Mon, 01 Jul 2002 19:59:37 +0100
-------------------
>
>
> --On Thursday, June 27, 2002 06:26:25 PM +0100 Simon Shapiro
> <shimon@nomis-storage.com> wrote:
>
> > Thax for looking into this problem.
> >
> > However, I would like to suggest that you may have dismissed the
> > problem a bit too quickly.
>
> No, I understood it.
>
> You need to take a look at the C standard.
>
> If ints have 32 bits, (1 << 32) has undefined behavior.
Great! Thanx.
Simon
>
> --
> Mark Mitchell mark@codesourcery.com
> CodeSourcery, LLC http://www.codesourcery.com
>
Sincerely,
Simon Shapiro, CEO
Nomis Storage, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
@ 2002-06-27 15:56 Mark Mitchell
0 siblings, 0 replies; 4+ messages in thread
From: Mark Mitchell @ 2002-06-27 15:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7139; it has been noted by GNATS.
From: Mark Mitchell <mark@codesourcery.com>
To: Simon Shapiro <shimon@nomis-storage.com>,
"mmitchel@gcc.gnu.org" <mmitchel@gcc.gnu.org>,
"gcc-bugs@gcc.gnu.org" <gcc-bugs@gcc.gnu.org>,
"gcc-prs@gcc.gnu.org" <gcc-prs@gcc.gnu.org>,
"nobody@gcc.gnu.org" <nobody@gcc.gnu.org>,
"shimon@simon-shapiro.com" <shimon@simon-shapiro.com>,
"gcc-gnats@gcc.gnu.org" <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
Date: Thu, 27 Jun 2002 15:46:41 -0700
--On Thursday, June 27, 2002 06:26:25 PM +0100 Simon Shapiro
<shimon@nomis-storage.com> wrote:
> Thax for looking into this problem.
>
> However, I would like to suggest that you may have dismissed the
> problem a bit too quickly.
No, I understood it.
You need to take a look at the C standard.
If ints have 32 bits, (1 << 32) has undefined behavior.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
@ 2002-06-27 15:36 Simon Shapiro
0 siblings, 0 replies; 4+ messages in thread
From: Simon Shapiro @ 2002-06-27 15:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7139; it has been noted by GNATS.
From: Simon Shapiro <shimon@nomis-storage.com>
To: mmitchel@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, shimon@simon-shapiro.com, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
Date: Thu, 27 Jun 2002 18:26:25 +0100
Thax for looking into this problem.
However, I would like to suggest that you may have dismissed the
problem a bit too quickly.
I am making this bold assumption based on my understanding that:
1 << 31 = 0x0000000080000000, and not 0xffffffff80000000
1 << 32 = 0x0000000100000000, and not 0x0000000000000001
Am I wrong?
Perhaps the example was
too complicated. Try this one:
#include <stdio.h>
int
main()
{
unsigned long long i64;
int index;
for (index = 0; index < 64; index++) {
i64 = 1 << index;
(void)fprintf(stdout, "1 << %d = %qx\n", index, i64);
}
return(0);
}
-------------------
> Synopsis: Shifting 1 through a 64bit int fails at 32bit line
>
> State-Changed-From-To: open->closed
> State-Changed-By: mmitchel
> State-Changed-When: Thu Jun 27 15:07:03 2002
> State-Changed-Why:
> Not a defect.
>
>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g
cc&pr=7139
>
Sincerely,
Simon Shapiro, CEO
Nomis Storage, Inc.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7139: Shifting 1 through a 64bit int fails at 32bit line
@ 2002-06-27 15:12 mmitchel
0 siblings, 0 replies; 4+ messages in thread
From: mmitchel @ 2002-06-27 15:12 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, nobody, shimon
Synopsis: Shifting 1 through a 64bit int fails at 32bit line
State-Changed-From-To: open->closed
State-Changed-By: mmitchel
State-Changed-When: Thu Jun 27 15:07:03 2002
State-Changed-Why:
Not a defect.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7139
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-07-02 0:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-01 17:06 c/7139: Shifting 1 through a 64bit int fails at 32bit line Simon Shapiro
-- strict thread matches above, loose matches on Subject: below --
2002-06-27 15:56 Mark Mitchell
2002-06-27 15:36 Simon Shapiro
2002-06-27 15:12 mmitchel
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).