]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/6g, cmd/8g, cmd/5g: make the undefined instruction have no successors
authorDaniel Morsing <daniel.morsing@gmail.com>
Tue, 11 Feb 2014 20:25:40 +0000 (20:25 +0000)
committerDaniel Morsing <daniel.morsing@gmail.com>
Tue, 11 Feb 2014 20:25:40 +0000 (20:25 +0000)
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

src/cmd/5g/prog.c
src/cmd/6g/prog.c
src/cmd/8g/prog.c

index e5b8fbd279703c2cb4934250c9454a9a560bd380..3e42721365ee0db7c350d0dc819e08d4e10bacda 100644 (file)
@@ -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},
index 657cc9f7710222a3976c0cfdb14cf5a2e4596a17..71f44a3e20f50945d0a9abebb99f645bbe3a3f8f 100644 (file)
@@ -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},
index 7745d503b82194f30e1fd186ee307227b63e1e3c..0162b02881c3870d3160de2a04c272a24abcaf34 100644 (file)
@@ -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},