NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: port-hp300/50852: src/sys/arch/hp300/stand/common/ite.c:239: bad expression



The following reply was made to PR port-hp300/50852; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: port-hp300/50852: src/sys/arch/hp300/stand/common/ite.c:239: bad
 expression
Date: Mon, 29 Feb 2016 15:09:10 +0000

 On Sat, Feb 27, 2016 at 06:40:01PM +0000, Joerg Sonnenberger wrote:
  >  Ironically, for the pre-increment version, it is highly
  >  likely that no sane compiler ever did not do the correct thing, but
  >  that's beside the point.
 
 That's not true. A reasonable implementation of pre/post-increment
 effects is to write them back at the next sequence point, so you'd get
 
    t1 = whichconsole + 1
    t2 = whichconsole + 1
    t3 = t2 % (NITE+1)
    whichconsole = t3
    whichconsole = t1
 
 which after further obvious simplifications turns into
 
    whichconsole = whichconsole + 1
 
 aka The Wrong Thing.
 
 Anyway, regardless of whether you're channeling Dan Pop it's all
 irrelevant; code of this form should not be allowed to exist.
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index