This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/8604: <integer>-1 evaluates wrong or causes compiler error
- From: flemming dot e at get2net dot dk
- To: gcc-gnats at gcc dot gnu dot org
- Cc: fls at ti dot com
- Date: 16 Nov 2002 10:31:41 -0000
- Subject: c/8604: <integer>-1 evaluates wrong or causes compiler error
- Reply-to: flemming dot e at get2net dot dk
>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: