public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects,  seemingly in simplify-rtx.c/simplify_plus_minus
@ 2020-04-16  1:03 gcc at octaforge dot org
  2020-04-16  6:53 ` [Bug target/94611] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16  1:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

            Bug ID: 94611
           Summary: gccgo hangs (infinite loop) on complex projects,
                    seemingly in simplify-rtx.c/simplify_plus_minus
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: gcc at octaforge dot org
                CC: cmang at google dot com
  Target Milestone: ---

Created attachment 48283
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48283&action=edit
debugger steps

Attempting to compile complicated projects, such as bootstrapping the official
Go compiler (regardless of version), using gccgo will result in the gc1 process
entering infinite loop.

Configuration:

- GCC 9.3.0 (as far as I know, all 9.x series are known to do this, but I had
it work on some version of 8.x some time ago)
- ppc64le architecture (seems to affect at very least all other PowerPC)
- Linux

The gc1 process will keep running forever and keep growing in RSS.

By attaching into the process, I was able to narrow it down to
'simplify_plus_minus' from simplify-rtx.c.

Unfortunately, I wasn't able to isolate a trivial test case. It seems to happen
when building any sufficiently complex project. Trivial things build alright,
and gccgo can also bootstrap itself (when building a cross-toolchain).

I've never seen this happen with C/C++, so I suspect the gccgo frontend is
generating bogus data that the backend can't process.

Attached is the debugger output stepping through the call, one whole iteration,
on GCC 9.3.0.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
@ 2020-04-16  6:53 ` rguenth at gcc dot gnu.org
  2020-04-16 14:00 ` gcc at octaforge dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-04-16  6:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iant at google dot com
          Component|rtl-optimization            |target
             Target|ppc64le-linux-gnu           |powerpc64le-linux-gnu

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Without a testcase it's impossible to say what is going wrong.  Can you at
least point to a specific source [revision] this reproduces on?  Not sure if
there's
something like "preprocessed source" for Go.  Ian?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
  2020-04-16  6:53 ` [Bug target/94611] " rguenth at gcc dot gnu.org
@ 2020-04-16 14:00 ` gcc at octaforge dot org
  2020-04-16 14:06 ` gcc at octaforge dot org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 14:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #2 from Daniel Kolesa <gcc at octaforge dot org> ---
It reproduces on any GCC 9.x series, and when building *any* version of the
official Go compiler (tested 1.12-1.14), and many other projects (e.g. gitea).
I'm not sure if it reproduces on x86_64, as I don't have any machines to test
that on available right now (I can test that later). If I knew a specific
revision of gcc in which it started happening, I would've patched it myself,
but bisecting several years worth of gcc development is a bit outside of the
free time I have available right now.

Unfortunately I generally don't use Go, so isolating a test case is harder for
me than for other things

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
  2020-04-16  6:53 ` [Bug target/94611] " rguenth at gcc dot gnu.org
  2020-04-16 14:00 ` gcc at octaforge dot org
@ 2020-04-16 14:06 ` gcc at octaforge dot org
  2020-04-16 14:08 ` gcc at octaforge dot org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 14:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #3 from Daniel Kolesa <gcc at octaforge dot org> ---
The steps I took to reproduce the problem:

1) Grab a Go source release
2) Install gccgo including the 'go' command
3) Then do something like:

cd go-1.x
export GOROOT_BOOTSTRAP=/usr/lib/go/9.3.0
export GOROOT=$PWD
export GOROOT_FINAL=/usr/lib/go
export GOARCH=ppc64le # or amd64, or ...

cd src
bash make.bash --no-clean -v

The build will run for a while. Apparently the command that hangs is:

/usr/bin/gccgo -c -O2 -g
-fdebug-prefix-map=/tmp/go-build771879105=/tmp/go-build
-gno-record-gcc-switches -fgo-pkgpath=bootstrap/cmd/internal/obj/x86 -o
/tmp/go-build771879105/b032/_go_.o -I
/tmp/go-build771879105/b032/_importcfgroot_
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/a.out.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/aenum.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/anames.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/asm6.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/avx_optabs.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/evex.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/list6.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/obj6.go
/home/q66/go/pkg/bootstrap/src/bootstrap/cmd/internal/obj/x86/ytab.go

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (2 preceding siblings ...)
  2020-04-16 14:06 ` gcc at octaforge dot org
@ 2020-04-16 14:08 ` gcc at octaforge dot org
  2020-04-16 14:51 ` gcc at octaforge dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 14:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #4 from Daniel Kolesa <gcc at octaforge dot org> ---
Oh, also, sorry, the process that *actually* gets stuck is go1, not gc1, that
was a typo.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (3 preceding siblings ...)
  2020-04-16 14:08 ` gcc at octaforge dot org
@ 2020-04-16 14:51 ` gcc at octaforge dot org
  2020-04-16 14:53 ` gcc at octaforge dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 14:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

Daniel Kolesa <gcc at octaforge dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|powerpc64le-linux-gnu       |

--- Comment #5 from Daniel Kolesa <gcc at octaforge dot org> ---
okay, I can reproduce this hanging on x86_64 as well.

It does not loop in the same place though, but instead in alias.c, around
true_dependence_1.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (4 preceding siblings ...)
  2020-04-16 14:51 ` gcc at octaforge dot org
@ 2020-04-16 14:53 ` gcc at octaforge dot org
  2020-04-16 15:42 ` gcc at octaforge dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 14:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #6 from Daniel Kolesa <gcc at octaforge dot org> ---
Another thing of note, the gccgo command that hangs is the same on both x86_64
and ppc64le

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (5 preceding siblings ...)
  2020-04-16 14:53 ` gcc at octaforge dot org
@ 2020-04-16 15:42 ` gcc at octaforge dot org
  2020-04-16 16:48 ` ian at airs dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 15:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

Daniel Kolesa <gcc at octaforge dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |ppc64le-linux-gnu

--- Comment #7 from Daniel Kolesa <gcc at octaforge dot org> ---
more observations: the x86_64 build does eventually finish (though it takes a
while), so it's probably not the same thing.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (6 preceding siblings ...)
  2020-04-16 15:42 ` gcc at octaforge dot org
@ 2020-04-16 16:48 ` ian at airs dot com
  2020-04-16 17:20 ` gcc at octaforge dot org
  2020-04-16 17:37 ` ian at airs dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ian at airs dot com @ 2020-04-16 16:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ian at airs dot com

--- Comment #8 from Ian Lance Taylor <ian at airs dot com> ---
Can you try passing -fno-var-tracking to the compilation command?  Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (7 preceding siblings ...)
  2020-04-16 16:48 ` ian at airs dot com
@ 2020-04-16 17:20 ` gcc at octaforge dot org
  2020-04-16 17:37 ` ian at airs dot com
  9 siblings, 0 replies; 11+ messages in thread
From: gcc at octaforge dot org @ 2020-04-16 17:20 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #9 from Daniel Kolesa <gcc at octaforge dot org> ---
it finishes with -fno-var-tracking, though it does take up a few gigs of memory
and takes a while, this is consistent with the default behavior on x86_64 where
it does the same thing.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [Bug target/94611] gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus
  2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
                   ` (8 preceding siblings ...)
  2020-04-16 17:20 ` gcc at octaforge dot org
@ 2020-04-16 17:37 ` ian at airs dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ian at airs dot com @ 2020-04-16 17:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94611

--- Comment #10 from Ian Lance Taylor <ian at airs dot com> ---
Thanks.  This may be another example of https://gcc.gnu.org/PR94466.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-04-16 17:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-16  1:03 [Bug go/94611] New: gccgo hangs (infinite loop) on complex projects, seemingly in simplify-rtx.c/simplify_plus_minus gcc at octaforge dot org
2020-04-16  6:53 ` [Bug target/94611] " rguenth at gcc dot gnu.org
2020-04-16 14:00 ` gcc at octaforge dot org
2020-04-16 14:06 ` gcc at octaforge dot org
2020-04-16 14:08 ` gcc at octaforge dot org
2020-04-16 14:51 ` gcc at octaforge dot org
2020-04-16 14:53 ` gcc at octaforge dot org
2020-04-16 15:42 ` gcc at octaforge dot org
2020-04-16 16:48 ` ian at airs dot com
2020-04-16 17:20 ` gcc at octaforge dot org
2020-04-16 17:37 ` ian at airs dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).