cmd/compile/internal/gc: handle weird map literals in key dedup
cmd/compile/internal/gc: handle weird map literals in key dedup

We compute whether two keys k1 and k2 in a map literal are duplicates by
constructing the expression OEQ(k1, k2) and calling the constant
expression evaluator on that expression, then extracting the boolean
result.

Unfortunately, the constant expression evaluator can fail for various
reasons.  I'm not really sure why it is dying in the case of 12536, but
to be safe we should use the result only if we get a constant back (if
we get a constant back, it must be boolean).  This probably isn't a
permanent fix, but it should be good enough for 1.5.2.

A permanent fix would be to ensure that the constant expression
evaluator can always work for map literal keys, and if not the compiler
should generate an error saying that the key isn't a constant (or isn't
comparable to some specific other key).

This patch has the effect of allowing the map literal to compile when
constant eval of the OEQ fails.  If the keys are really equal (which the
map impl will notice at runtime), one will overwrite the other in the
resulting map.  Not great, but better than a compiler crash.

Fixes #12536

Change-Id: Ic151a5e3f131c2e8efa0c25c9218b431c55c1b30
Reviewed-on: https://go-review.googlesource.com/14400
Reviewed-by: Ian Lance Taylor <87e9c6d529889242b7e184afb632328636553ab4@golang.org>

Endika/go,golang/go,joshsammut/go,theass/go,josharian/go,NunoEdgarGub1/go,Badredapple/go,mikekap/go,myPublicGit/go,deft-code/go,chinanjjohn2012/go,snowsnail/go,CAFxX/go,cookerzhu/go,jdhenke/go,beealone/go,Pulgafree/go,mwhudson/go,fjballest/golang,yasarkunduz/go,likesea/go,Cofyc/go,arschles/go-1,GeorgiCodes/go,alex-zhang/go,odeke-em/go,4ad/go,jacobsa/go,cyberroadie/go,sndnvaps/go,deft-code/go,ifagnosticism/go,jacobhaven/go,Jordanzuo/go,skatsuta/go,ImJasonH/go,yasarkunduz/go,Cofyc/go,kim-racktop/go,binarycrusader/go,GeorgiCodes/go,cyberroadie/go,samanalysis/go,Pulgafree/go,danielsoro/go,nawawi/go,b54898533/go,snowsnail/go,vsdutka/go,codestation/go,ganboing/go-esx,vsekhar/elastic-go,Cofyc/go,kim-racktop/go,snowsnail/go,fjballest/golang,derekmarcotte/go,jacobhaven/go,zhangg/go,skatsuta/go,4ad/go,famorted/go,Endika/go,miolini/go,ganboing/go-esx,jacobsa/go,myPublicGit/go,ganboing/go-esx,dpatel06/go,skatsuta/go,chinanjjohn2012/go,Badredapple/go,chinanjjohn2012/go,xiuzhifu/go,vanloswang/go,kim-racktop/go,momchil-velikov/go,gdey/go,dterei/go,Endika/go,b54898533/go,devpadawan/go,miolini/go,ichu501/go,Jordanzuo/go,samanalysis/go,roth1002/go,jonasi/go,arschles/golang-go,odeke-em/go,b54898533/go,mdp/go,golang/go,Endika/go,myPublicGit/go,famorted/go,vsdutka/go,joshsammut/go,yangzhongj/go,kim-racktop/go,linux-on-ibm-z/go,odeke-em/go,vanloswang/go,CAFxX/go,gdey/go,arschles/golang-go,binarycrusader/go,suncycheng/go,Badredapple/go,golang/go,Samurais/go,roth1002/go,mwhudson/go,ericsnowcurrently/go,devpadawan/go,yangzhongj/go,theass/go,jdhenke/go,dterei/go,dpatel06/go,famorted/go,famorted/go,linux-on-ibm-z/go,dpatel06/go,polyverse-security/go,polyverse-security/go,miolini/go,vsekhar/elastic-go,vsdutka/go,arschles/go-1,ImJasonH/go,theass/go,momchil-velikov/go,golang/go,roth1002/go,theif519/go,beealone/go,NunoEdgarGub1/go,cookerzhu/go,cloudflare/go,jacobsa/go,theif519/go,ichu501/go,rachtsingh/gogojuice,mwhudson/go,suncycheng/go,ichu501/go,xujianhai/go,josharian/go,alex-zhang/go,snowsnail/go,Samurais/go,yasarkunduz/go,snowsnail/go,polyverse-security/go,zhangg/go,ifagnosticism/go,theass/go,ichu501/go,rachtsingh/gogojuice,jacobsa/go,jonasi/go,fjballest/golang,golang/go,mwhudson/go,theif519/go,yangzhongj/go,famorted/go,4ad/go,vsdutka/go,dterei/go,arschles/golang-go,Badredapple/go,deft-code/go,derekmarcotte/go,miolini/go,mdp/go,ericsnowcurrently/go,ImJasonH/go,suncycheng/go,vsekhar/elastic-go,vsekhar/elastic-go,kim-racktop/go,derekmarcotte/go,vsekhar/elastic-go,stormltf/go,akutz/go,joshsammut/go,danielsoro/go,binarycrusader/go,ImJasonH/go,codestation/go,myPublicGit/go,mikekap/go,malvira/go,cyberroadie/go,mwhudson/go,vanloswang/go,theass/go,Endika/go,beealone/go,ganboing/go-esx,Cofyc/go,malvira/go,momchil-velikov/go,zhangg/go,cookerzhu/go,sndnvaps/go,zhangg/go,xiuzhifu/go,mikekap/go,golang/go,CAFxX/go,gdey/go,mdp/go,codestation/go,odeke-em/go,malvira/go,akutz/go,dpatel06/go,goodlang/good,akutz/go,binarycrusader/go,odeke-em/go,mwhudson/go,linux-on-ibm-z/go,beealone/go,vsekhar/elastic-go,CAFxX/go,dterei/go,josharian/go,polyverse-security/go,ImJasonH/go,devpadawan/go,deft-code/go,CarterTsai/go,Badredapple/go,skatsuta/go,goodlang/good,josharian/go,jonasi/go,arschles/golang-go,gdey/go,CarterTsai/go,Cofyc/go,Samurais/go,binarycrusader/go,yasarkunduz/go,binarycrusader/go,devpadawan/go,roth1002/go,dterei/go,cookerzhu/go,NunoEdgarGub1/go,goodlang/good,skatsuta/go,GeorgiCodes/go,samanalysis/go,jacobsa/go,NunoEdgarGub1/go,cookerzhu/go,likesea/go,Jordanzuo/go,likesea/go,danielsoro/go,derekmarcotte/go,myPublicGit/go,kim-racktop/go,jonasi/go,xujianhai/go,derekmarcotte/go,xiuzhifu/go,momchil-velikov/go,derekmarcotte/go,ichu501/go,stormltf/go,dpatel06/go,ImJasonH/go,mwhudson/go,gdey/go,mwhudson/go,GeorgiCodes/go,theif519/go,myPublicGit/go,codestation/go,vanloswang/go,vsdutka/go,binarycrusader/go,b54898533/go,beealone/go,miolini/go,arschles/go-1,deft-code/go,yasarkunduz/go,stormltf/go,linux-on-ibm-z/go,zhangg/go,arschles/go-1,CAFxX/go,theif519/go,joshsammut/go,xiuzhifu/go,danielsoro/go,NunoEdgarGub1/go,goodlang/good,CarterTsai/go,nawawi/go,Jordanzuo/go,CarterTsai/go,beealone/go,derekmarcotte/go,alex-zhang/go,rachtsingh/gogojuice,rachtsingh/gogojuice,beealone/go,vsekhar/elastic-go,stormltf/go,yangzhongj/go,dpatel06/go,chinanjjohn2012/go,dterei/go,famorted/go,josharian/go,jdhenke/go,jonasi/go,GeorgiCodes/go,cookerzhu/go,xujianhai/go,ifagnosticism/go,Samurais/go,nawawi/go,mikekap/go,joshsammut/go,cyberroadie/go,stormltf/go,CAFxX/go,akutz/go,ImJasonH/go,malvira/go,goodlang/good,goodlang/good,alex-zhang/go,likesea/go,jacobhaven/go,samanalysis/go,suncycheng/go,ganboing/go-esx,alex-zhang/go,likesea/go,zhangg/go,derekmarcotte/go,famorted/go,cloudflare/go,kim-racktop/go,Samurais/go,yangzhongj/go,arschles/go-1,snowsnail/go,CarterTsai/go,Cofyc/go,snowsnail/go,roth1002/go,theif519/go,theif519/go,stormltf/go,b54898533/go,vsdutka/go,ifagnosticism/go,cookerzhu/go,Pulgafree/go,Jordanzuo/go,vanloswang/go,sndnvaps/go,fjballest/golang,Jordanzuo/go,devpadawan/go,NunoEdgarGub1/go,jonasi/go,ganboing/go-esx,goodlang/good,ericsnowcurrently/go,b54898533/go,4ad/go,polyverse-security/go,joshsammut/go,yangzhongj/go,golang/go,cloudflare/go,CarterTsai/go,ganboing/go-esx,goodlang/good,skatsuta/go,4ad/go,jacobsa/go,arschles/go-1,cloudflare/go,ericsnowcurrently/go,CarterTsai/go,jacobhaven/go,josharian/go,GeorgiCodes/go,jdhenke/go,malvira/go,suncycheng/go,jacobsa/go,sndnvaps/go,josharian/go,GeorgiCodes/go,Pulgafree/go,cookerzhu/go,codestation/go,nawawi/go,Badredapple/go,xujianhai/go,Samurais/go,devpadawan/go,arschles/golang-go,likesea/go,linux-on-ibm-z/go,nawawi/go,alex-zhang/go,xiuzhifu/go,GeorgiCodes/go,skatsuta/go,chinanjjohn2012/go,akutz/go,b54898533/go,samanalysis/go,cloudflare/go,yangzhongj/go,likesea/go,chinanjjohn2012/go,polyverse-security/go,vanloswang/go,malvira/go,fjballest/golang,rachtsingh/gogojuice,4ad/go,NunoEdgarGub1/go,arschles/golang-go,arschles/golang-go,miolini/go,jonasi/go,rachtsingh/gogojuice,xiuzhifu/go,ericsnowcurrently/go,deft-code/go,CAFxX/go,rachtsingh/gogojuice,fjballest/golang,jdhenke/go,Pulgafree/go,Badredapple/go,fjballest/golang,momchil-velikov/go,malvira/go,vanloswang/go,chinanjjohn2012/go,Cofyc/go,vsdutka/go,mikekap/go,theif519/go,odeke-em/go,xiuzhifu/go,nawawi/go,Samurais/go,ganboing/go-esx,theass/go,cyberroadie/go,roth1002/go,mdp/go,Pulgafree/go,samanalysis/go,arschles/golang-go,cyberroadie/go,ericsnowcurrently/go,golang/go,mdp/go,arschles/go-1,theass/go,mikekap/go,ImJasonH/go,josharian/go,devpadawan/go,akutz/go,famorted/go,linux-on-ibm-z/go,codestation/go,xujianhai/go,dpatel06/go,danielsoro/go,Badredapple/go,polyverse-security/go,danielsoro/go,suncycheng/go,Pulgafree/go,mikekap/go,sndnvaps/go,sndnvaps/go,ichu501/go,jacobsa/go,binarycrusader/go,theass/go,jacobhaven/go,dterei/go,likesea/go,yasarkunduz/go,yangzhongj/go,mikekap/go,akutz/go,sndnvaps/go,ichu501/go,joshsammut/go,xiuzhifu/go,beealone/go,roth1002/go,sndnvaps/go,rachtsingh/gogojuice,nawawi/go,jacobhaven/go,cloudflare/go,danielsoro/go,malvira/go,gdey/go,Pulgafree/go,arschles/go-1,4ad/go,miolini/go,skatsuta/go,jdhenke/go,vanloswang/go,dpatel06/go,samanalysis/go,cloudflare/go,dterei/go,miolini/go,ericsnowcurrently/go,stormltf/go,Endika/go,linux-on-ibm-z/go,momchil-velikov/go,ifagnosticism/go,snowsnail/go,chinanjjohn2012/go,Endika/go,Endika/go,momchil-velikov/go,mdp/go,gdey/go,zhangg/go,xujianhai/go,jacobhaven/go,jdhenke/go,stormltf/go,momchil-velikov/go,alex-zhang/go,mdp/go,Cofyc/go,devpadawan/go,jonasi/go,myPublicGit/go,roth1002/go,mdp/go,cloudflare/go,deft-code/go,deft-code/go,christopher-henderson/Go,Jordanzuo/go,Jordanzuo/go,linux-on-ibm-z/go,danielsoro/go,vsekhar/elastic-go,ifagnosticism/go,4ad/go,zhangg/go,joshsammut/go,odeke-em/go,xujianhai/go,odeke-em/go,yasarkunduz/go,xujianhai/go,myPublicGit/go,CAFxX/go,suncycheng/go,cyberroadie/go,Samurais/go,samanalysis/go,codestation/go,ifagnosticism/go,ericsnowcurrently/go,vsdutka/go,ichu501/go,codestation/go,gdey/go,yasarkunduz/go,jacobhaven/go,ifagnosticism/go,suncycheng/go,NunoEdgarGub1/go,akutz/go,b54898533/go,polyverse-security/go,alex-zhang/go,CarterTsai/go,fjballest/golang,nawawi/go,cyberroadie/go,kim-racktop/go,jdhenke/go