public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: flemming.e@get2net.dk
To: gcc-gnats@gcc.gnu.org
Cc: fls@ti.com
Subject: c/8604: <integer>-1 evaluates wrong or causes compiler error
Date: Fri, 22 Nov 2002 08:17:00 -0000	[thread overview]
Message-ID: <20021116103141.17310.qmail@sources.redhat.com> (raw)


>Number:         8604
>Category:       c
>Synopsis:       <integer>-1 evaluates wrong or causes compiler error
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 16 02:36:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Flemming Nyboe
>Release:        3.2
>Organization:
>Environment:
Windows ME
Executing GCC from ConTEXT, but DOS prompt execution gives same error.
>Description:
I'm getting an ICE on line 253 in main() "b=b-1". "b--" gives the same error. If I change that line to "b=b+1" I get no error.

Further, look at GC2.c line 193.
The expression "((LCDint == 0) && (i+1 >= digs))" evaluates correctly. If I write "((LCDint == 0) && (i >= (digs-1)))" it doesn't. The term "(i >= (digs-1)))" always eveluates to false.
>How-To-Repeat:
Hope you get the same when you compile my code.
>Fix:
As described in "Description", rearranging terms seem to help. I wonder if there's a special problem with a "-" sign right after an integer variable
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-11-16 10:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-22  8:17 flemming.e [this message]
2002-11-22  8:55 paolo

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=20021116103141.17310.qmail@sources.redhat.com \
    --to=flemming.e@get2net.dk \
    --cc=fls@ti.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).