public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jbright@winfordeng.com
To: gcc-gnats@gcc.gnu.org
Subject: target/10733: Modulus bug
Date: Sat, 10 May 2003 15:36:00 -0000 [thread overview]
Message-ID: <20030510152845.17262.qmail@sources.redhat.com> (raw)
>Number: 10733
>Category: target
>Synopsis: Modulus bug
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sat May 10 15:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: John Bright
>Release: avr-gcc (GCC) 3.2.3 20030221 (Debian prerelease)
>Organization:
>Environment:
Linux host system, AVR cross-compiler for Atmel AT90S8535
>Description:
C Source code:
--------------------------------
int t1;
t1=2;
t1=(t1+40)%30;
--------------------------------
This results in t1 having a value of 42.
Compile options:
avr-gcc -g -Os -Wall -Wstrict-prototypes -mmcu=at90s8535
I found this bug while using avr-gcc 3.0.3 (in Debian stable). I tried out with 3.2.3 and the same bug still exists.
>How-To-Repeat:
>Fix:
In the above example, the bug can be worked-around by doing the modulus separately:
t1=2;
t1=t1+40;
t1%=30;
>Release-Note:
>Audit-Trail:
>Unformatted:
next reply other threads:[~2003-05-10 15:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-10 15:36 jbright [this message]
2003-05-10 18:46 Dara Hazeghi
2003-05-10 21:26 John Bright
2003-05-10 21:56 Dara Hazeghi
2003-05-10 23:06 John Bright
2003-05-12 0:16 Dara Hazeghi
2003-05-12 11:11 giovannibajo
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=20030510152845.17262.qmail@sources.redhat.com \
--to=jbright@winfordeng.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).