From: Daniel Morsing Date: Tue, 11 Feb 2014 20:25:40 +0000 (+0000) Subject: cmd/6g, cmd/8g, cmd/5g: make the undefined instruction have no successors X-Git-Tag: go1.3beta1~768 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=85e4cb2f10eb1bbc147b6b549f48eb243c3517e3;p=gostls13.git cmd/6g, cmd/8g, cmd/5g: make the undefined instruction have no successors The UNDEF instruction was listed in the instruction data as having the next instruction in the stream as its successor. This confused the optimizer into adding a load where it wasn't needed, in turn confusing the liveness analysis pass for GC bitmaps into thinking that the variable was live. Fixes #7229. LGTM=iant, rsc R=golang-codereviews, bradfitz, iant, dave, rsc CC=golang-codereviews https://golang.org/cl/56910045 --- diff --git a/src/cmd/5g/prog.c b/src/cmd/5g/prog.c index e5b8fbd279..3e42721365 100644 --- a/src/cmd/5g/prog.c +++ b/src/cmd/5g/prog.c @@ -26,7 +26,7 @@ static ProgInfo progtable[ALAST] = { [ATEXT]= {Pseudo}, [AFUNCDATA]= {Pseudo}, [APCDATA]= {Pseudo}, - [AUNDEF]= {OK}, + [AUNDEF]= {Break}, [AUSEFIELD]= {OK}, [ACHECKNIL]= {LeftRead}, [AFATVARDEF]= {Pseudo | RightWrite}, diff --git a/src/cmd/6g/prog.c b/src/cmd/6g/prog.c index 657cc9f771..71f44a3e20 100644 --- a/src/cmd/6g/prog.c +++ b/src/cmd/6g/prog.c @@ -38,7 +38,7 @@ static ProgInfo progtable[ALAST] = { [ATEXT]= {Pseudo}, [AFUNCDATA]= {Pseudo}, [APCDATA]= {Pseudo}, - [AUNDEF]= {OK}, + [AUNDEF]= {Break}, [AUSEFIELD]= {OK}, [ACHECKNIL]= {LeftRead}, [AFATVARDEF]= {Pseudo | RightWrite}, diff --git a/src/cmd/8g/prog.c b/src/cmd/8g/prog.c index 7745d503b8..0162b02881 100644 --- a/src/cmd/8g/prog.c +++ b/src/cmd/8g/prog.c @@ -38,7 +38,7 @@ static ProgInfo progtable[ALAST] = { [ATEXT]= {Pseudo}, [AFUNCDATA]= {Pseudo}, [APCDATA]= {Pseudo}, - [AUNDEF]= {OK}, + [AUNDEF]= {Break}, [AUSEFIELD]= {OK}, [ACHECKNIL]= {LeftRead}, [AFATVARDEF]= {Pseudo | RightWrite},