public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/5304: gcc-20011231 generates incorrect divmod code for chars
@ 2002-02-19 4:04 jakub
0 siblings, 0 replies; 3+ messages in thread
From: jakub @ 2002-02-19 4:04 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jakub, pbarada
Synopsis: gcc-20011231 generates incorrect divmod code for chars
State-Changed-From-To: open->closed
State-Changed-By: jakub
State-Changed-When: Tue Feb 19 04:04:23 2002
State-Changed-Why:
Fixed.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5304
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c/5304: gcc-20011231 generates incorrect divmod code for chars
@ 2002-02-01 8:01 jakub
0 siblings, 0 replies; 3+ messages in thread
From: jakub @ 2002-02-01 8:01 UTC (permalink / raw)
To: gcc-bugs, gcc-prs, jakub, nobody, pbarada
Synopsis: gcc-20011231 generates incorrect divmod code for chars
Responsible-Changed-From-To: unassigned->jakub
Responsible-Changed-By: jakub
Responsible-Changed-When: Fri Feb 1 08:01:06 2002
Responsible-Changed-Why:
Testing patch.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5304
^ permalink raw reply [flat|nested] 3+ messages in thread
* c/5304: gcc-20011231 generates incorrect divmod code for chars
@ 2002-01-07 12:26 pbarada
0 siblings, 0 replies; 3+ messages in thread
From: pbarada @ 2002-01-07 12:26 UTC (permalink / raw)
To: gcc-gnats
>Number: 5304
>Category: c
>Synopsis: gcc-20011231 generates incorrect divmod code for chars
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Mon Jan 07 12:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Peter Barada
>Release: 3.1 20011231 (experimental)
>Organization:
Motorola, Inc.
>Environment:
System: Linux hyper.wm.sps.mot.com 2.4.2-2 #1 Sun Apr 8 20:41:30 EDT 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: /home/pbarada/work/cvs-wavemark/cross-linux-tools/gcc-20011231/configure --target=i686-linux --prefix=/tmp/crap8/ --enable-languages=c --with-local-prefix=/tmp/crap/i686-linux
>Description:
The divmod code produces truncated magic numbers (at least for i686)
when the value of the divmod is a char. If the value is a short/int,
the result is calculated in int, and is correct.
The result of the code given is:
Huh? modulus is 141
Huh? quotient is 63
Which is *quite* wrong.
>How-To-Repeat:
typedef unsigned char ufix8;
ufix8 val = 7;
ufix8 expected = 1;
main(int argc, char *argv[])
{
ufix8 result;
int err = 0;
result = val % 6;
if (result != expected) {
printf("Huh? modulus is %d\n", result);
err++;
}
result = val / 6;
if (result != expected) {
printf("Huh? quotient is %d\n", result);
err++;
}
exit(err?-1:0);
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-02-19 12:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-19 4:04 c/5304: gcc-20011231 generates incorrect divmod code for chars jakub
-- strict thread matches above, loose matches on Subject: below --
2002-02-01 8:01 jakub
2002-01-07 12:26 pbarada
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).