diff options
| author | Russ Cox <rsc@golang.org> | 2012-05-30 16:47:56 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2012-05-30 16:47:56 -0400 |
| commit | f2bd3a977d105f8a4ee3f4c86fe8daf52f629495 (patch) | |
| tree | 921e6cab9c4fd97d7106ebf07e8fbe7422d7797c /src/cmd/6l | |
| parent | 8820ab5da9da5528e256d3a519723fdf44ddc75f (diff) | |
| download | go-f2bd3a977d105f8a4ee3f4c86fe8daf52f629495.tar.xz | |
cmd/6l, cmd/8l, cmd/5l: add AUNDEF instruction
On 6l and 8l, this is a real instruction, guaranteed to
cause an 'undefined instruction' exception.
On 5l, we simulate it as BL to address 0.
The plan is to use it as a signal to the linker that this
point in the instruction stream cannot be reached
(hence the changes to nofollow). This will help the
compiler explain that panicindex and friends do not
return without having to put a list of these functions
in the linker.
R=ken2
CC=golang-dev
https://golang.org/cl/6255064
Diffstat (limited to 'src/cmd/6l')
| -rw-r--r-- | src/cmd/6l/6.out.h | 2 | ||||
| -rw-r--r-- | src/cmd/6l/optab.c | 2 | ||||
| -rw-r--r-- | src/cmd/6l/pass.c | 1 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/cmd/6l/6.out.h b/src/cmd/6l/6.out.h index 4271944ce4..cd861c038e 100644 --- a/src/cmd/6l/6.out.h +++ b/src/cmd/6l/6.out.h @@ -745,6 +745,8 @@ enum as AMOVQL, ABSWAPL, ABSWAPQ, + + AUNDEF, ALAST }; diff --git a/src/cmd/6l/optab.c b/src/cmd/6l/optab.c index 717d083e99..0716fa4453 100644 --- a/src/cmd/6l/optab.c +++ b/src/cmd/6l/optab.c @@ -1294,6 +1294,8 @@ Optab optab[] = { AMOVQL, yrl_ml, Px, 0x89 }, + { AUNDEF, ynone, Px, 0x0f, 0x0b }, + { AEND }, 0 }; diff --git a/src/cmd/6l/pass.c b/src/cmd/6l/pass.c index 758f61d651..fc89fd8fc3 100644 --- a/src/cmd/6l/pass.c +++ b/src/cmd/6l/pass.c @@ -79,6 +79,7 @@ nofollow(int a) case ARETFL: case ARETFQ: case ARETFW: + case AUNDEF: return 1; } return 0; |
