[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2017-05-05
 CC||cmang at google dot com,
   ||marxin at gcc dot gnu.org
  Component|lto |go
   Assignee|unassigned at gcc dot gnu.org  |ian at airs dot com
 Ever confirmed|0   |1
  Known to fail||6.3.0, 7.1.0, 8.0

--- Comment #2 from Martin Liška  ---
Confirmed, checking assert is triggered for:

Breakpoint 1, symtab_node::get_partitioning_class (this=0x769dab80) at
../../gcc/symtab.c:1866
1866  gcc_checking_assert (vnode->definition);
(gdb) p vnode->debug()
__go_tdn_unicode.SpecialCase$gc/164 (__go_tdn_unicode.SpecialCase$gc)
@0x769dab80
  Type: variable
  Body removed by symtab_remove_unreachable_nodes
  Visibility: public artificial
  References: 
  Referring:
__go_td_S6_._f.$fpv16_.go_bytes._case1pN19_unicode.SpecialCasexe$gc/40 (addr)
  Availability: not_available
  Varpool flags:
$3 = void
(gdb) bt
#0  symtab_node::get_partitioning_class (this=0x769dab80) at
../../gcc/symtab.c:1866
#1  0x00b7f8cd in lto_output_varpool_node (ob=,
ob=, encoder=0x2515e80, node=0x769dab80) at
../../gcc/lto-cgraph.c:615
#2  output_symtab () at ../../gcc/lto-cgraph.c:1026
#3  0x00b92ad3 in lto_output () at ../../gcc/lto-streamer-out.c:2390
#4  0x00c072bf in write_lto () at ../../gcc/passes.c:2582
#5  0x00c0b221 in ipa_write_summaries_1 (encoder=0x2515e80) at
../../gcc/passes.c:2646
#6  ipa_write_summaries () at ../../gcc/passes.c:2706
#7  0x008b3610 in ipa_passes () at ../../gcc/cgraphunit.c:2373
#8  symbol_table::compile (this=0x76864100) at ../../gcc/cgraphunit.c:2467
#9  0x008b5e18 in symbol_table::finalize_compilation_unit
(this=0x76864100) at ../../gcc/cgraphunit.c:2626
#10 0x00ce7f4a in compile_file () at ../../gcc/toplev.c:493
#11 0x0071ff6c in do_compile () at ../../gcc/toplev.c:2004
#12 toplev::main (this=this@entry=0x7fffdaf0, argc=,
argc@entry=17, argv=, argv@entry=0x7fffdbf8) at
../../gcc/toplev.c:2138
#13 0x00722489 in main (argc=17, argv=0x7fffdbf8) at
../../gcc/main.c:40

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #3 from Martin Liška  ---
Ian can you please take a look?

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-08 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #4 from Ian Lance Taylor  ---
This appears to work in GCC 7.  At least, I can see a crash when using GCC 6,
but I don't see a crash when using revision 246286.  Which revision are you
using for the crash you see?

I'm afraid that I do not have the time to track down a failure in GCC 5 or 6 if
it is working on trunk.

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-09 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #5 from Martin Liška  ---
(In reply to Ian Lance Taylor from comment #4)
> This appears to work in GCC 7.  At least, I can see a crash when using GCC
> 6, but I don't see a crash when using revision 246286.  Which revision are
> you using for the crash you see?
> 
> I'm afraid that I do not have the time to track down a failure in GCC 5 or 6
> if it is working on trunk.

I can reproduce it with current trunk revision r247781. It's a checking assert,
so that's maybe reason why you can't see it. I have to install the compiler and
invoke:

$ gcc bytes_decl.go bytes.go -flto -o a.out

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-10 Thread ian at airs dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #6 from Ian Lance Taylor  ---
I'm sorry, I still can't recreate it.  I'm now at SVN revision 247848.

Note that I just committed a number of changes to the Go frontend, and I was
using those changes when I tested before.  I don't see why they would affect
this, but perhaps they do.  If that is the case, then you will no longer see a
problem either.

I edited the gcc_checking_assert at symtab.c:1865 to be a plain gcc_assert,
though I think that shouldn't matter.

This is what I see:

> gccgo -flto pr64238/bytes_decl.go pr64238/bytes.go
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Count: error:
undefined reference to 'go.bytes.IndexByte'
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Count: error:
undefined reference to 'go.bytes.Equal'
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
undefined reference to 'go.bytes.IndexByte'
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
undefined reference to 'go.bytes.IndexByte'
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
undefined reference to 'go.bytes.Equal'
/tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.LastIndex: error:
undefined reference to 'go.bytes.Equal'
/tmp/ccerLD54.ltrans0.ltrans.o::function bytes.genSplit: error:
undefined reference to 'go.bytes.Equal'
collect2: error: ld returned 1 exit status

> gccgo -flto pr64238/bytes_decl.go pr64238/bytes.go -fgo-pkgpath=bytes
> echo $?
0

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #7 from Martin Liška  ---
(In reply to Ian Lance Taylor from comment #6)
> I'm sorry, I still can't recreate it.  I'm now at SVN revision 247848.
> 
> Note that I just committed a number of changes to the Go frontend, and I was
> using those changes when I tested before.  I don't see why they would affect
> this, but perhaps they do.  If that is the case, then you will no longer see
> a problem either.
> 
> I edited the gcc_checking_assert at symtab.c:1865 to be a plain gcc_assert,
> though I think that shouldn't matter.
> 
> This is what I see:
> 
> > gccgo -flto pr64238/bytes_decl.go pr64238/bytes.go
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Count: error:
> undefined reference to 'go.bytes.IndexByte'
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Count: error:
> undefined reference to 'go.bytes.Equal'
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
> undefined reference to 'go.bytes.IndexByte'
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
> undefined reference to 'go.bytes.IndexByte'
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.Index: error:
> undefined reference to 'go.bytes.Equal'
> /tmp/ccerLD54.ltrans0.ltrans.o::function go.bytes.LastIndex:
> error: undefined reference to 'go.bytes.Equal'
> /tmp/ccerLD54.ltrans0.ltrans.o::function bytes.genSplit: error:
> undefined reference to 'go.bytes.Equal'
> collect2: error: ld returned 1 exit status
> 
> > gccgo -flto pr64238/bytes_decl.go pr64238/bytes.go -fgo-pkgpath=bytes
> > echo $?
> 0

I can confirm that current trunk works fine. However GCC 7.1 is affected.
Can you reproduce it for 7.1? Are you planning to backport some patches in
order to fix the release?

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-11 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #8 from Martin Liška  ---
There's link to docker image that illustrates that for 7.1:
https://hub.docker.com/r/marxin/docker-gcc-pr64238/builds/buqt3slnzjlvm858fg6j78t/

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-11 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #9 from ian at gcc dot gnu.org  ---
Author: ian
Date: Thu May 11 23:52:54 2017
New Revision: 247937

URL: https://gcc.gnu.org/viewcvs?rev=247937&root=gcc&view=rev
Log:
PR go/64238
* go-gcc.cc (Gcc_backend::implicit_variable_reference): Set
DECL_EXTERNAL, clear TREE_STATIC.

Modified:
trunk/gcc/go/ChangeLog
trunk/gcc/go/go-gcc.cc

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-11 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #10 from ian at gcc dot gnu.org  ---
Author: ian
Date: Thu May 11 23:53:13 2017
New Revision: 247938

URL: https://gcc.gnu.org/viewcvs?rev=247938&root=gcc&view=rev
Log:
PR go/64238
* go-gcc.cc (Gcc_backend::implicit_variable_reference): Set
DECL_EXTERNAL, clear TREE_STATIC.

Modified:
branches/gcc-7-branch/gcc/go/ChangeLog
branches/gcc-7-branch/gcc/go/go-gcc.cc

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-11 Thread ian at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #11 from ian at gcc dot gnu.org  ---
Author: ian
Date: Thu May 11 23:53:29 2017
New Revision: 247939

URL: https://gcc.gnu.org/viewcvs?rev=247939&root=gcc&view=rev
Log:
PR go/64238
* go-gcc.cc (Gcc_backend::implicit_variable_reference): Set
DECL_EXTERNAL, clear TREE_STATIC.

Modified:
branches/gcc-6-branch/gcc/go/ChangeLog
branches/gcc-6-branch/gcc/go/go-gcc.cc

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

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

Ian Lance Taylor  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from Ian Lance Taylor  ---
Thanks, should be fixed now.

[Bug go/64238] ICE in get_partitioning_class, at symtab.c:1775

2017-05-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64238

--- Comment #13 from Martin Liška  ---
(In reply to Ian Lance Taylor from comment #12)
> Thanks, should be fixed now.

I can confirm that it fixed the problem.