<p dir="auto">by <strong>randynwalsh</strong>:</p>
<pre class="notranslate">1. What is a short input program that triggers the error?

import "fmt"

const FE = "xFE"

func main() {
   fmt.Println(uint8(string(254)[0]))
}

2. What is the full compiler output?

missed typecheck [2b5b15067950]
.   LITERAL-I120 u(1) a(1) x(0+0) uint8
prog.go:8: internal compiler error: missed typecheck


3. What version of the compiler are you using?  (Run it with the -V flag.)

<a href="http://golang.org/doc/play" rel="nofollow">http://golang.org/doc/play</a></pre>
<pre class="notranslate">cgo on OpenBSD/amd64 is currently unable to generate correct z-files, due to what
appears to be a bug in our debug/dwarf package. Attached is a minimal types_openbsd.go
file and the corresponding .o file that gcc creates. The sample dwarf.go should produce
the following output for struct timeval:

  Name: timeval
  Name: tv_sec
  Name: tv_usec

However, it currently produces:

  Name: timeval
  Name: it_interval
  Name: tv_usec

Due to duplication tv_sec is encoded as a strp, however debug/dwarf ends up determining
that it has an offset of 0x0 instead of the correct 0xc, which obviously results in the
incorrect value.

It is possible that this is compiler related, however I doubt that this is the case
since readelf is able to correctly process the .o file on multiple platforms (in this
case linux/amd64):

$ readelf --debug-dump _cgo_.o | grep -A 10 :\ timeval
    &lt;b80&gt;   DW_AT_name        : timeval   
    &lt;b88&gt;   DW_AT_byte_size   : 16    
    &lt;b89&gt;   DW_AT_decl_file   : 6 
    &lt;b8a&gt;   DW_AT_decl_line   : 90    
    &lt;b8b&gt;   DW_AT_sibling     : &lt;0xbb0&gt; 
 &lt;2&gt;&lt;b8f&gt;: Abbrev Number: 14 (DW_TAG_member)
    &lt;b90&gt;   DW_AT_name        : (indirect string, offset: 0xc): tv_sec    
    &lt;b94&gt;   DW_AT_decl_file   : 7 
    &lt;b95&gt;   DW_AT_decl_line   : 50    
    &lt;b96&gt;   DW_AT_type        : &lt;0x361&gt; 
    &lt;b9a&gt;   DW_AT_data_member_location: 2 byte block: 23 0    (DW_OP_plus_uconst: 0)</pre>
<p dir="auto">Attachments:</p>
<ol dir="auto">
<li><a href="https://storage.googleapis.com/go-attachment/4107/0/types_openbsd.go" rel="nofollow">types_openbsd.go</a> (392 bytes)</li>
<li><a href="https://storage.googleapis.com/go-attachment/4107/0/dwarf.go" rel="nofollow">dwarf.go</a> (476 bytes)</li>
<li><a href="https://storage.googleapis.com/go-attachment/4107/0/_cgo_.o" rel="nofollow"><em>cgo</em>.o</a> (6544 bytes)</li>
</ol>