[Bug go/78763] New: go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-10 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

Bug ID: 78763
   Summary: go1: internal compiler error: in do_get_backend, at
go/gofrontend/expressions.cc:8352
   Product: gcc
   Version: 6.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: go
  Assignee: ian at airs dot com
  Reporter: jdanek at redhat dot com
CC: cmang at google dot com
  Target Milestone: ---

Created attachment 40299
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40299&action=edit
Dockerfile for the failing build

I've been building the attached Dockerfile and I got the following error from
it

[ 80%] Built target reactor_send_cpp
Scanning dependencies of target go-build
# qpid.apache.org/amqp
go1: internal compiler error: in do_get_backend, at
go/gofrontend/expressions.cc:8352
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[2]: *** [proton-c/bindings/go/CMakeFiles/go-build] Error 2
proton-c/bindings/go/CMakeFiles/go-build.dir/build.make:49: recipe for target
'proton-c/bindings/go/CMakeFiles/go-build' failed
CMakeFiles/Makefile2:1791: recipe for target
'proton-c/bindings/go/CMakeFiles/go-build.dir/all' failed
Makefile:127: recipe for target 'all' failed
make[1]: *** [proton-c/bindings/go/CMakeFiles/go-build.dir/all] Error 2
make: *** [all] Error 2
The command '/bin/sh -c make' returned a non-zero code: 2

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-10 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #1 from Jiri Danek  ---
How reproducible: Always
Reproduction steps: docker run --rm -it jdanekrh/gcc-78763 make

(I pushed the partially built container to Docker Hub (docker.io) and the above
command fetches it from there and runs make in it.)

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-12 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #3 from Jiri Danek  ---
On Mon, Dec 12, 2016 at 11:14 AM, marxin at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> --- Comment #2 from Martin Liška  ---
> Hi. I can confirm that the docker command triggers ICE. However manually
> cloning the repository and building with GCC 6.2 works fine.
>
> Can you please investigate which version of compiler is used during docker
> build? Is there any option to 'chroot' to build env in docker to run the
> command manually?
>

You can run

docker run --rm -it jdanekrh/gcc-78763 bash

which will give you Bash terminal inside the container. You can then run
make (as in the original reproduction steps), or do something else. You are
the roor user and the container is based on debian jessie. You can use
apt-get to install things.

You can also run

docker run --rm -it -v `pwd`:/mnt jdanekrh/gcc-78763 bash


which does the same as before, but in addition mounts current directory as
/mnt inside the container, so you can use it to move files to and from the
container.


I am not really expert on docker, so this may not be the smartest way to do
this.

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-13 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #5 from Jiri Danek  ---
On Mon, Dec 12, 2016 at 3:10 PM, marxin at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763
>
> --- Comment #4 from Martin Liška  ---
> I was able to run bash in the container, however I can't isolate the issue
> as
> it executes an python script with some ENV variables. Can you please test
> it
> with openSUSE?
>

I gave it a go. I installed gcc6 package and also gcc6-go and gcc6-c++, but
apparently cmake did not detect go compiler on its own and so did not
attempt to compile go binding. I will try to look into it more tomorrow,
why is this happening.

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-14 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #6 from Jiri Danek  ---
I can reproduce this on OpenSuse Tumbleweed (in Docker)

$ docker run --rm -it jdanekrh/gcc-78763-opensuse make

]...]

[ 66%] Built target reactor_send_cpp
Scanning dependencies of target go-build
# qpid.apache.org/amqp
go1: internal compiler error: in do_get_backend, at
go/gofrontend/expressions.cc:8352
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
make[2]: *** [proton-c/bindings/go/CMakeFiles/go-build.dir/build.make:57:
proton-c/bindings/go/CMakeFiles/go-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1890:
proton-c/bindings/go/CMakeFiles/go-build.dir/all] Error 2
make: *** [Makefile:139: all] Error 2

I used the following Dockerfile:

FROM library/opensuse:tumbleweed
MAINTAINER jda...@redhat.com

RUN zypper refresh
RUN zypper --non-interactive install --force-resolution git gcc6 gcc6-go
gcc6-c++ cmake libuv-devel python-pip swig openssl openssl-devel

#RUN pip install python-qpid-proton

RUN git clone https://github.com/apache/qpid-proton.git
WORKDIR /qpid-proton

RUN mkdir /qpid-proton/build
WORKDIR /qpid-proton/build
RUN CC=gcc-6 CXX=g++-6 cmake -DGO_EXE=/usr/bin/go-6 -DCMAKE_BUILD_TYPE=Debug ..

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-23 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

Jiri Danek  changed:

   What|Removed |Added

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

--- Comment #10 from Jiri Danek  ---
I am trying to compile qpid-proton with gcc snapshot (again in docker,
https://hub.docker.com/r/jdanekrh/nightly-gccgo-trunk-docker-image/) and as far
as I can tell, the go binding package does compile successfully. So I'd say
this bug is resolved.

What _does_ fail though is compilation of the go sample program which uses the
binding package. It is quite likely this is a bug in the build script which was
never before tested with gccgo.

FYI, the compilation error when compiling the sample program

make[2]: Entering directory '/qpid-proton/build'
/usr/bin/python /qpid-proton/proton-c/env.py --
GOPATH=/qpid-proton/proton-c/bindings/go
CGO_CFLAGS=-I/qpid-proton/proton-c/include\
-I/qpid-proton/build/proton-c/include CGO_LDFLAGS=-L/qpid-proton/build/proton-c
PN_INTEROP_DIR=/qpid-proton/tests/interop /usr/local/bin/go build -gccgoflags
-Wl,-rpath=/qpid-proton/build/proton-c -o
/qpid-proton/build/examples/go/electron/broker
/qpid-proton/examples/go/electron/broker.go
# command-line-arguments
../examples/go/electron/broker.go:30:9: error: import file '../util' not found
  "../util"
 ^
../examples/go/electron/broker.go:69:16: error: expected package
  queuesutil.Queues   // A collection of queues.
^
../examples/go/electron/broker.go:79:8: error: expected package
  q util.Queue
^
../examples/go/electron/broker.go:57:14: error: reference to undefined name
'util'
   queues:util.MakeQueues(*qsize),
  ^
../examples/go/electron/broker.go:97:4: error: reference to undefined name
'util'
util.Debugf("Accept error: %v", err)
^
../examples/go/electron/broker.go:102:3: error: reference to undefined name
'util'
   util.Debugf("Accepted %v", c)
   ^
../examples/go/electron/broker.go:137:3: error: reference to undefined name
'util'
   util.Debugf("incoming: %v", in)
   ^
../examples/go/electron/broker.go:115:2: error: range clause must have array,
slice, string, map, or channel type
  for in := range c.connection.Incoming() {
  ^
../examples/go/electron/broker.go:139:2: error: reference to undefined name
'util'
  util.Debugf("incoming closed: %v", c.connection)
  ^
../examples/go/electron/broker.go:147:4: error: reference to undefined name
'util'
util.Debugf("%v: received %v", receiver, util.FormatMessage(rm.Message))
^
../examples/go/electron/broker.go:147:45: error: reference to undefined name
'util'
util.Debugf("%v: received %v", receiver, util.FormatMessage(rm.Message))
 ^
../examples/go/electron/broker.go:151:4: error: reference to undefined name
'util'
util.Debugf("%v error: %v", receiver, err)
^
../examples/go/electron/broker.go:162:4: error: reference to undefined name
'util'
util.Debugf("%v closed: %v", sender, sender.Error())
^
../examples/go/electron/broker.go:168:4: error: reference to undefined name
'util'
util.Debugf("%v: sent %v", sender, util.FormatMessage(m))
^
../examples/go/electron/broker.go:168:39: error: reference to undefined name
'util'
util.Debugf("%v: sent %v", sender, util.FormatMessage(m))
   ^
../examples/go/electron/broker.go:185:13: error: invalid type for make function
  sentMap := make(map[sentMessage]bool)
 ^
../examples/go/electron/broker.go:196:4: error: argument 1 must be a map
delete(sentMap, sm)
^
../examples/go/electron/broker.go:199:5: error: reference to undefined name
'util'
 util.Debugf("message %v put back, status %v, error %v",
 ^
../examples/go/electron/broker.go:200:6: error: reference to undefined name
'util'
  util.FormatMessage(sm.m), outcome.Status, outcome.Error)
  ^
../examples/go/electron/broker.go:115:6: error: invalid type for range clause
  for in := range c.connection.Incoming() {
  ^
../examples/go/electron/broker.go:167:3: error: expected channel
   case m := <-q:
   ^
../examples/go/electron/broker.go:188:3: error: expected channel
   case sm, ok := <-b.sent: // A local sender records that it has sent a
message.
   ^
../examples/go/electron/broker.go:194:3: error: expected channel
   case outcome := <-b.acks: // The message outcome is available
   ^
../examples/go/electron/broker.go:167:15: error: expected channel
   case m := <-q:
   ^
../examples/go/electron/broker.go:188:21: error: expected channel
   case sm, ok := <-b.sent: // A local sender records that it has sent a
message.
 ^
../examples/go/electron/broker.go:194:22: error: expected channel
   case outcome := <-b.acks: // The message outcome is available
  ^
make[2]: *** [examples/go

[Bug go/78912] New: Relative import when compiling with `go build` is not resolved

2016-12-23 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78912

Bug ID: 78912
   Summary: Relative import when compiling with `go build` is not
resolved
   Product: gcc
   Version: 7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: go
  Assignee: ian at airs dot com
  Reporter: jdanek at redhat dot com
CC: cmang at google dot com
  Target Milestone: ---

Created attachment 40410
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40410&action=edit
reproducer_project.zip

The attached project compiles with go tool

$ go version
go version go1.7.3 linux/amd64
$ GOPATH=`pwd` go build electron/broker.go
$ ./broker
Print from broker.go
Print from util.go

It does not compile with gccgo (I am running gcc in Docker)

$ docker run -v `pwd`:/mnt --rm -it jdanekrh/nightly-gccgo-trunk-docker-image
root@d454c37d5d3e:/# cd /mnt
root@d454c37d5d3e:/mnt# go version
go version go1.7.1 gccgo (GCC) 7.0.0 20161223 (experimental) linux/amd64
root@d454c37d5d3e:/mnt# GOPATH=`pwd` go build electron/broker.go
# command-line-arguments
electron/broker.go:4:12: error: import file '../util' not found
 "../util"
^
electron/broker.go:10:5: error: reference to undefined name 'util'
 util.PrintSomething()

I have tried setting the -fgo-relative-import-path option, (GOPATH=`pwd` go
build -gccgoflags -fgo-relative-import-path=`pwd`/electron electron/broker.go)
but I could not make it work that way either.

This bug may be similar to https://github.com/golang/go/issues/3759. The
reproducer from that bug compiles fine for me (relative import in that
reproducer starts ./, not ../ like in this case).

[Bug go/78763] go1: internal compiler error: in do_get_backend, at go/gofrontend/expressions.cc:8352

2016-12-23 Thread jdanek at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78763

--- Comment #11 from Jiri Danek  ---
I am opening "Bug 78912 - Relative import when compiling with `go build` is not
resolved" for the relative import error.