[Bug go/68072] malformed DWARF TagVariable entry

2015-11-20 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #9 from Ian Lance Taylor  ---
Thanks very much for taking the time to narrow down the test case.  That is
nice and simple.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-20 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #10 from Ian Lance Taylor  ---
FYI, refiled as https://golang.org/issue/13344 and sent out
https://golang.org/cl/17151 , a variant of the patch you suggested.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-20 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #11 from ian at gcc dot gnu.org  ---
Author: ian
Date: Fri Nov 20 22:48:47 2015
New Revision: 230685

URL: https://gcc.gnu.org/viewcvs?rev=230685=gcc=rev
Log:
PR go/68072
cmd/cgo: ignore vars with no name or type if they have a AttrSpecification

Backport of master CL https://golang.org/cl/17151.

Fixes https://gcc.gnu.org/PR/68072.

Reviewed-on: https://go-review.googlesource.com/17152

Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/libgo/go/cmd/cgo/gcc.go

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-20 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #12 from ian at gcc dot gnu.org  ---
Author: ian
Date: Fri Nov 20 22:49:06 2015
New Revision: 230686

URL: https://gcc.gnu.org/viewcvs?rev=230686=gcc=rev
Log:
PR go/68072
cmd/cgo: ignore vars with no name or type if they have a AttrSpecification

Backport of master CL https://golang.org/cl/17151.

Fixes https://gcc.gnu.org/PR/68072.

Reviewed-on: https://go-review.googlesource.com/17152

Modified:
branches/gcc-5-branch/libgo/go/cmd/cgo/gcc.go

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-20 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

Ian Lance Taylor  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #13 from Ian Lance Taylor  ---
Should be fixed on mainline and GCc 5 branch.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-18 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #8 from Dominik Vogt  ---
Created attachment 36750
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36750=edit
Test case

This is the requested minimal test program.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-17 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #7 from Dominik Vogt  ---
All right, I'll try to extract a minimal test case.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-11 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

Ian Lance Taylor  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2015-11-11
 Ever confirmed|0   |1

--- Comment #6 from Ian Lance Taylor  ---
The patch seems plausible but we'll need a test case, even if that test case
only fails with current GCC.  It looks like the GCC change might be due to the
early-debug work.  It looks like it should be pretty easy to boil down the test
case into a small piece of code that fails.

[Bug go/68072] malformed DWARF TagVariable entry

2015-11-10 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #5 from Dominik Vogt  ---
Any opinions on the patch in comment 3?

[Bug go/68072] malformed DWARF TagVariable entry

2015-10-26 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #2 from Ian Lance Taylor  ---
This is not a known bug.  I wonder what is special about this package that it
causes it to happen?  I don't see anything new in GCC related to
DW_AT_specification.

I think the place to fix in the Go sources would be cmd/cgo/gcc.go.


[Bug go/68072] malformed DWARF TagVariable entry

2015-10-26 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #3 from Dominik Vogt  ---
Created attachment 36588
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36588=edit
Experimental fix

The attached patch fixes the problem for us by skipping DW_TAG_variable DWARF
info that only contains a DW_AT_specification (no DW_AT_type and DW_AT_name),
assuming that they are just duplicate declarations/definitions.


[Bug go/68072] malformed DWARF TagVariable entry

2015-10-26 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #4 from Dominik Vogt  ---
@comment 2

I can't see anything special that the file does:

-- secp256.go --
package secp256k1

/*
#cgo CFLAGS: -I./secp256k1
...
#include "./secp256k1/src/secp256k1.c"
*/
import "C"
-- END --

Then in

-- secp256k1.c --
const secp256k1_nonce_function_t secp256k1_nonce_function_rfc6979 =
nonce_function_rfc6979;
-- END --

Just this one occurence of the symbol "secp256k1_nonce_function_rfc6979".


[Bug go/68072] malformed DWARF TagVariable entry

2015-10-26 Thread vogt at linux dot vnet.ibm.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68072

--- Comment #1 from Dominik Vogt  ---
It seems that the DWARF library is unable to handle DW_AT_specification:

-- snip --
 <1><7b4>: Abbrev Number: 27 (DW_TAG_variable)
<7b5>   DW_AT_specification: <0x8b>
<7b9>   DW_AT_decl_file   : 13
<7ba>   DW_AT_decl_line   : 77
<7bb>   DW_AT_location: 9 byte block: 3 0 0 0 0 0 0 4 80   
(DW_OP_addr: 480)


 <1><8b>: Abbrev Number: 10 (DW_TAG_variable)
<8c>   DW_AT_name: (indirect string, offset: 0x3c4):
secp256k1_nonce_function_rfc6979
<90>   DW_AT_decl_file   : 14
<91>   DW_AT_decl_line   : 104
<92>   DW_AT_type: <0x98>
<96>   DW_AT_external: 1
<97>   DW_AT_declaration : 1
-- snip --

DW_AT_name and DW_AT_type are provided by the DW_TAG_variable that the
DW_AT_specification attribute is pointing to.  Is that a known problem; ist
there already a fix?  Otherwise I can try to make a patch.