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


Groups > comp.compilers > #2290 > unrolled thread

Re: Optimization techniques and undefined behavior in Go

Started byIan Lance Taylor <ianlancetaylor@gmail.com>
First post2019-05-06 21:16 -0700
Last post2019-05-06 21:16 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.compilers


Contents

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

#2290 — Re: Optimization techniques and undefined behavior in Go

FromIan Lance Taylor <ianlancetaylor@gmail.com>
Date2019-05-06 21:16 -0700
SubjectRe: Optimization techniques and undefined behavior in Go
Message-ID<19-05-055@comp.compilers>
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

[toc] | [standalone]


Back to top | Article view | comp.compilers


csiph-web