public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem.
@ 2002-11-23  1:16 mchen
  0 siblings, 0 replies; 3+ messages in thread
From: mchen @ 2002-11-23  1:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8624
>Category:       target
>Synopsis:       gcc 2.95.3 (arm-linux-gcc) char type problem.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 18 11:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Transdimension
>Release:        gcc version 2.95.3 20010315 release
>Organization:
>Environment:
The problem always occurs when a progrom is cross-compiled 
on x86 linux for arm targets. 
>Description:
A char variable taking a negative value will be cast 
to a positive result when being cast to a int variable.

If it is modified by "signed char" instead of just "char" 
at declearation, the problem is gone.
>How-To-Repeat:
Compile the attached file t.c on a pc with 
 gcc t.c -o t
Run the  ./t, the result will be:
  i=-128  j=-128  i=ffffff80  j=ffffff80
 ii=-128 jj=-128 ii=ffffff80 jj=ffffff80

Compile with 
 arm-linux-gcc t.c -o t
Run the  ./t  on an arm platform, the result will be:
  i=-128  j=-128   i=ffffff80   j=ffffff80
 ii=128  jj=128   ii=80  jj=80
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="t.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="t.c"

LyogCWZpbGU6IHQuYwoqLwoKI2luY2x1ZGUgPHN0ZGlvLmg+CgptYWluKCkKeyAKICBzaWduZWQg
Y2hhciAgaTsgaW50ICBqOwogICAgICAgICBjaGFyIGlpOyBpbnQgamo7CgoJaSA9IC0xMjg7Cglq
ID0gaTsKCWlpID0gLTEyODsKCWpqID0gaWk7CgoJcHJpbnRmKCJcbiAgaT0lZCAgaj0lZCAgIGk9
JXggIGo9JXhcbiIsIGksIGosICBpLCBqKTsKCXByaW50ZigiXG4gaWk9JWQgamo9JWQgIGlpPSV4
IGpqPSV4XG4iLGlpLGpqLCBpaSxqaik7Cn0KCi8qIAlyZXN1bHQgb24gYSB4ODYgcGM6CgogIGk9
LTEyOCAgaj0tMTI4ICAgaT1mZmZmZmY4MCAgaj1mZmZmZmY4MAoKIGlpPS0xMjggamo9LTEyOCAg
aWk9ZmZmZmZmODAgamo9ZmZmZmZmODAKKi8KCi8qIAlyZXN1bHQgb24gYW4gYXJtIHBsYXRmb3Jt
OgoKICBpPS0xMjggIGo9LTEyOCAgIGk9ZmZmZmZmODAgIGo9ZmZmZmZmODAKCiBpaT0xMjggamo9
MTI4ICBpaT04MCBqaj04MAoqLwoK


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem.
@ 2002-11-23  4:49 mchen
  0 siblings, 0 replies; 3+ messages in thread
From: mchen @ 2002-11-23  4:49 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/8624; it has been noted by GNATS.

From: mchen <mchen@transdimension.com>
To: schwab@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
   mchen@transdimension.com, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem.
Date: Mon, 18 Nov 2002 12:09:01 -0800

 Thanks!
 
 schwab@gcc.gnu.org wrote:
 > 
 > Synopsis: gcc 2.95.3 (arm-linux-gcc) char type problem.
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: schwab
 > State-Changed-When: Mon Nov 18 12:03:29 2002
 > State-Changed-Why:
 >     Not a bug, char is unsigned by default on arm.
 > 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8624


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem.
@ 2002-11-23  1:56 schwab
  0 siblings, 0 replies; 3+ messages in thread
From: schwab @ 2002-11-23  1:56 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, mchen, nobody

Synopsis: gcc 2.95.3 (arm-linux-gcc) char type problem.

State-Changed-From-To: open->closed
State-Changed-By: schwab
State-Changed-When: Mon Nov 18 12:03:29 2002
State-Changed-Why:
    Not a bug, char is unsigned by default on arm.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8624


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-11-18 20:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-23  1:16 target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem mchen
2002-11-23  1:56 schwab
2002-11-23  4:49 mchen

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).