public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rupert.tombs at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug go/101851] New: gccgo crashes compiling `x, y := int(0)`
Date: Tue, 10 Aug 2021 19:27:53 +0000	[thread overview]
Message-ID: <bug-101851-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 101851
           Summary: gccgo crashes compiling `x, y := int(0)`
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: rupert.tombs at gmail dot com
                CC: cmang at google dot com
  Target Milestone: ---

Full reproduction: https://go.godbolt.org/z/39MnE5GEn

This source crashes gccgo:

```
package main

func main() {
    x, y := int(0)
    _, _ = x, y
}
```

apparently due to the incorrect short declaration; 
gc reports "assignment mismatch: 2 variables but 1 value".


Full details:

```
Using built-in specs.
COLLECT_GCC=/opt/compiler-explorer/gcc-11.2.0/bin/gccgo
Target: x86_64-linux-gnu
Configured with: ../gcc-11.2.0/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu
--enable-languages=c,c++,fortran,ada,go,d --enable-ld=yes --enable-gold=yes
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-linker-build-id
--enable-lto --enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build-gcc--binutils-2.36.1
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (Compiler-Explorer-Build-gcc--binutils-2.36.1) 
COLLECT_GCC_OPTIONS='-fdiagnostics-color=always' '-g' '-o' '/app/output.s'
'-masm=intel' '-S' '-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
'-march=x86-64' '-dumpdir' '/app/'

/opt/compiler-explorer/gcc-11.2.0/bin/../libexec/gcc/x86_64-linux-gnu/11.2.0/go1
<source> -quiet -dumpdir /app/ -dumpbase output.go -dumpbase-ext .go
-masm=intel -mtune=generic -march=x86-64 -g -version -fdiagnostics-color=always
-o /app/output.s
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc/x86_64-linux-gnu/11.2.0
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc/x86_64-linux-gnu
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc/x86_64-linux-gnu/11.2.0/../../../../lib64
-L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib64 -L/usr/lib/x86_64-linux-gnu
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc/x86_64-linux-gnu/11.2.0/../../../../x86_64-linux-gnu/lib
-L/opt/compiler-explorer/gcc-11.2.0/bin/../lib/gcc/x86_64-linux-gnu/11.2.0/../../..
GNU Go (Compiler-Explorer-Build-gcc--binutils-2.36.1) version 11.2.0
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.6,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Go (Compiler-Explorer-Build-gcc--binutils-2.36.1) version 11.2.0
(x86_64-linux-gnu)
        compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.6,
MPC version 1.0.3, isl version isl-0.18-GMP

GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
```

All compilation options
```
-g -o /tmp/compiler-explorer-compiler2021710-5217-aatpg5.psufb/output.s
-masm=intel -S -fdiagnostics-color=always -v -save-temps
/tmp/compiler-explorer-compiler2021710-5217-aatpg5.psufb/example.go
```

Full backtrace:
```
go1: internal compiler error: in do_flatten, at go/gofrontend/statements.cc:323
0x16b2bf9 internal_error(char const*, ...)
        ???:0
0x6e5266 fancy_abort(char const*, int, char const*)
        ???:0
0x7a1700 Variable_declaration_statement::do_flatten(Gogo*, Named_object*,
Block*, Statement_inserter*)
        ???:0
0x7508fc Flatten::statement(Block*, unsigned long*, Statement*)
        ???:0
0x7a4014 Statement::traverse(Block*, unsigned long*, Traverse*)
        ???:0
0x75451d Block::traverse(Traverse*)
        ???:0
0x754799 Function::traverse(Traverse*)
        ???:0
0x7547f0 Flatten::function(Named_object*)
        ???:0
0x75939b Bindings::traverse(Traverse*, bool)
        ???:0
0x759541 Gogo::traverse(Traverse*)
        ???:0
0x759b28 Gogo::flatten()
        ???:0
0x74f12f go_parse_input_files(char const**, unsigned int, bool, bool)
        ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
```

Thank you for maintaining gccgo!

             reply	other threads:[~2021-08-10 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10 19:27 rupert.tombs at gmail dot com [this message]
2021-08-11  2:36 ` [Bug go/101851] " cvs-commit at gcc dot gnu.org
2021-08-11  2:41 ` ian at airs dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-101851-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).