Path: csiph.com!goblin3!goblin.stu.neva.ru!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: George Neuner Newsgroups: comp.compilers Subject: Re: Bounds checking, Optimization techniques and undefined behavior Date: Sun, 05 May 2019 17:10:04 -0400 Organization: A noiseless patient Spider Lines: 20 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-05-030@comp.compilers> References: <19-04-021@comp.compilers> <19-04-023@comp.compilers> <19-04-037@comp.compilers> <19-04-039@comp.compilers> <19-04-042@comp.compilers> <19-04-044@comp.compilers> <19-04-047@comp.compilers> <19-05-004@comp.compilers> <19-05-006@comp.compilers> <19-05-016@comp.compilers> <19-05-017@comp.compilers> <19-05-026@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="18150"; mail-complaints-to="abuse@iecc.com" Keywords: hardware, debug, comment Posted-Date: 05 May 2019 21:39:41 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2265 >[Are you referring to the old BOUND instruction or the newer MPX feature. -John] Mostly I was referring to the new(ish, Skylake and later) MPX stuff. The larger point is that the architecture had at least some ability to check bounds in hardware for a very long time: BOUND existed at least from i286 onward (if not before). 64-bit mode dropped it, but the need for *something* to do the same job was deemed great enough that the MPX extensions were introduced. The MPX approach is more flexible and faster than BOUND was ... but it still is far too slow for heavy use. IMO it just rehashes many of the old problems that existed with segments: programmer visible registers, too few of them, too complicated setup of data structures in memory, etc. YMMV, George [Bounds checking in the x86 is pretty old. It wasn't in the 8086/88 but it was in the 286. -John]