public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: mchen@transdimension.com
To: gcc-gnats@gcc.gnu.org
Subject: target/8624: gcc 2.95.3 (arm-linux-gcc) char type problem.
Date: Sat, 23 Nov 2002 01:16:00 -0000	[thread overview]
Message-ID: <20021118194955.24037.qmail@sources.redhat.com> (raw)


>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


             reply	other threads:[~2002-11-18 19:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-23  1:16 mchen [this message]
2002-11-23  1:56 schwab
2002-11-23  4:49 mchen

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=20021118194955.24037.qmail@sources.redhat.com \
    --to=mchen@transdimension.com \
    --cc=gcc-gnats@gcc.gnu.org \
    /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).