This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/8604: <integer>-1 evaluates wrong or causes compiler error


>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]