Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.compilers > #2290

Re: Optimization techniques and undefined behavior in Go

From Ian Lance Taylor <ianlancetaylor@gmail.com>
Newsgroups comp.compilers
Subject Re: Optimization techniques and undefined behavior in Go
Date 2019-05-06 21:16 -0700
Organization Compilers Central
Message-ID <19-05-055@comp.compilers> (permalink)

Show all headers | View raw


Martin Ward <martin@gkc.org.uk> writes:

> There are many language in which all behaviour is defined:
> for example, Go has no undefined behaviour. Some behaviour
> may be "unspecified" (eg it could do X, or could do Y,
> but cannot do anything else).

(Setting aside the use of the "unsafe" package, of course.)

We hope to get to that point, but it's not true today.  The language
spec is not clear on the effects of race conditions.  With today's
implementations you can set up a race condition that lets you change a
slice pointer to anything at all, which effectively leads to undefined
behavior even without using the "unsafe" package.  See, e.g.,
https://research.swtch.com/gorace.

Ian

Back to comp.compilers | Previous | Next | Find similar


Thread

Re: Optimization techniques and undefined behavior in Go Ian Lance Taylor <ianlancetaylor@gmail.com> - 2019-05-06 21:16 -0700

csiph-web