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]

Re: c++/7322: Code to Compute Numeric Limits "runs away" when -O<any> used


Synopsis: Code to Compute Numeric Limits "runs away" when -O<any> used

State-Changed-From-To: open->closed
State-Changed-By: nathan
State-Changed-When: Tue Jul 16 01:41:42 2002
State-Changed-Why:
    The code is ill formed.
    There are tests such as
    	if (T (max + 1) > max)
    where max & T are signed types. [5]/5 says that
    if the result is not in the range if representable values,
    the behaviour is undefined. gcc implements modulo arithmetic
    for unsigned types, and undefined behaviour for signed types.
    The optimized therefore knows that max + 1 must always
    be greater than max.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7322


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