On Thu, May 16, 2002 at 06:47:39AM -0400, Thomas David Rivers wrote:
>
> Terry Lambert <[EMAIL PROTECTED]> wrote:
> > RS/6000's didn't used to use PPC processors at all; so it's
> > probably intentional software compatability.
>
> I'm confused then - the one we have here seems to. There
> was
> Sounds like you should forward this to [EMAIL PROTECTED] :-)
> CC audit@ (and current@) so we can all see what the GNU people say.
> Don't forget to show the output of `cc -v'.
knu has already created a gnats pr with gcc and posted the url.
--
David W. Chapman Jr.
[EMAIL PROTECTED] Raintree
On Thu, May 16, 2002 at 12:06:49PM -0700, Bill Fenner wrote:
> >Specifically what is the problem? Given the program below, take the
> >ISO-C spec and explain the problem. Or even w/o the spec -- I haven't
> >been reading this thread.
>
> > > int
> > > main()
> > > {
> > >unsigned char i = 1
>Specifically what is the problem? Given the program below, take the
>ISO-C spec and explain the problem. Or even w/o the spec -- I haven't
>been reading this thread.
> > int
> > main()
> > {
> >unsigned char i = 127;
> >char j;
> >
> >printf("%d\n", ((char)(i << 1)));
This print
On Thu, May 16, 2002 at 08:31:19PM +0900, Akinori MUSHA wrote:
> > > So - yes - it seems gcc 3.1 does have a problem...
> > Indeed - easily determined by breaking down the expression.
> > So, who's gonna report it to gcc-bugs? knu?...
Specifically what is the problem? Given the program below, t
I've submitted a bug report to GCC GNATS:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gcc&pr=6677&cmd=view+audit-trail
Let's see how they handle this.
--
/
/__ __Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org
At Thu, 16 May 2002 21:58:56 +1000 (EST),
Bruce Evans wrote:
> > Somehow, specifying -fsigned-char, which I thought was the default,
> > fixed the problem. So, the cause may be in our configuration of gcc?
>
> -fsigned-char doesn't fix it for me. Neither does repacling "char" by
> "signed char"
On Thu, 16 May 2002, Akinori MUSHA wrote:
> [CC: obrien, who has been working on bringing in gcc 3.1]
>
> At Wed, 15 May 2002 20:46:06 -0700,
> Bill Fenner wrote:
> > So, who's gonna report it to gcc-bugs? knu?...
> >
> > int
> > main()
> > {
> >unsigned char i = 127;
> >char j;
> >
> >
[CC: obrien, who has been working on bringing in gcc 3.1]
At Wed, 15 May 2002 20:46:06 -0700,
Bill Fenner wrote:
> > So - yes - it seems gcc 3.1 does have a problem...
>
> Indeed - easily determined by breaking down the expression.
>
> So, who's gonna report it to gcc-bugs? knu?...
>
> int
>
Terry Lambert <[EMAIL PROTECTED]> wrote:
> Thomas David Rivers wrote:
> > Well - it's not counter-intuitive on many machines... For example,
> > on the IBM mainframe - there is an instruction to load a character
> > into a register - but not one that loads *and* sign-extends. So,
> > you can
Thomas David Rivers wrote:
> Well - it's not counter-intuitive on many machines... For example,
> on the IBM mainframe - there is an instruction to load a character
> into a register - but not one that loads *and* sign-extends. So,
> you can get much better code if characters are unsigned by d
> So - yes - it seems gcc 3.1 does have a problem...
Indeed - easily determined by breaking down the expression.
So, who's gonna report it to gcc-bugs? knu?...
int
main()
{
unsigned char i = 127;
char j;
printf("%d\n", ((char)(i << 1)));
j = ((char)(i << 1)) / 2;
printf("%d\n"
Terry Lambert <[EMAIL PROTECTED]> wrote:
>
> Bill Fenner wrote:
> > gcc 3.1 simply defaults to unsigned chars. 127 << 1 = 254; 254 / 2 = 127.
> >
> > My machine is too slow to test this expeditiously, but I'm trying
> > adding "#define DEFAULT_SIGNED_CHAR 1" into freebsd-native.h .
>
> I will
>
> I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
> following code differently (CFLAGS=-O):
>
> int main(void)
> {
> unsigned char i = 127;
> printf("%d\n", ((char)(i << 1)) / 2);
> return 0;
> }
>
> gcc 2.95.4 says it's -1, whereas gcc 3.1 says it's 127. On FreeBSD
Bill Fenner wrote:
> Duh. Sometimes I wish I had the patience to wait for my tests to complete
> before sharing my guesses. I jumped to a wildly incorrect conclusion; gcc
> 3.1 still defaults to signed chars. Sorry for the bizarre misdirection.
There goes my lunch money. 8-(.
Man, your expla
Duh. Sometimes I wish I had the patience to wait for my tests to complete
before sharing my guesses. I jumped to a wildly incorrect conclusion; gcc
3.1 still defaults to signed chars. Sorry for the bizarre misdirection.
Bill
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe
Bill Fenner wrote:
> gcc 3.1 simply defaults to unsigned chars. 127 << 1 = 254; 254 / 2 = 127.
>
> My machine is too slow to test this expeditiously, but I'm trying
> adding "#define DEFAULT_SIGNED_CHAR 1" into freebsd-native.h .
I will bet today's lunch money that you have found it for sure.
On Thu, May 16, 2002 at 02:42:34AM +0900, Akinori MUSHA wrote:
> I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
> following code differently (CFLAGS=-O):
>
> int main(void)
> {
> unsigned char i = 127;
> printf("%d\n", ((char)(i << 1)) / 2);
> return 0;
> }
I think GCC
gcc 3.1 simply defaults to unsigned chars. 127 << 1 = 254; 254 / 2 = 127.
My machine is too slow to test this expeditiously, but I'm trying
adding "#define DEFAULT_SIGNED_CHAR 1" into freebsd-native.h .
Bill
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" i
Akinori MUSHA wrote:
> I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
> following code differently (CFLAGS=-O):
>
> int main(void)
> {
> unsigned char i = 127;
> printf("%d\n", ((char)(i << 1)) / 2);
> return 0;
> }
>
Cool...
> gcc 2.95.4 says it's -1,
Promotion of
I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
following code differently (CFLAGS=-O):
int main(void)
{
unsigned char i = 127;
printf("%d\n", ((char)(i << 1)) / 2);
return 0;
}
gcc 2.95.4 says it's -1, whereas gcc 3.1 says it's 127. On FreeBSD
char should be signed, s
21 matches
Mail list logo