public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug go/101851] New: gccgo crashes compiling `x, y := int(0)`
@ 2021-08-10 19:27 rupert.tombs at gmail dot com
  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
  0 siblings, 2 replies; 3+ messages in thread
From: rupert.tombs at gmail dot com @ 2021-08-10 19:27 UTC (permalink / raw)
  To: gcc-bugs

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!

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

* [Bug go/101851] gccgo crashes compiling `x, y := int(0)`
  2021-08-10 19:27 [Bug go/101851] New: gccgo crashes compiling `x, y := int(0)` rupert.tombs at gmail dot com
@ 2021-08-11  2:36 ` cvs-commit at gcc dot gnu.org
  2021-08-11  2:41 ` ian at airs dot com
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-08-11  2:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Ian Lance Taylor <ian@gcc.gnu.org>:

https://gcc.gnu.org/g:fed7c1634e8e50600e20cb97dbfbd74ecbd5ba22

commit r12-2845-gfed7c1634e8e50600e20cb97dbfbd74ecbd5ba22
Author: Ian Lance Taylor <iant@golang.org>
Date:   Tue Aug 10 16:13:01 2021 -0700

    compiler: don't crash on a, b := int(0)

    Fixes PR go/101851

    Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/341330

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

* [Bug go/101851] gccgo crashes compiling `x, y := int(0)`
  2021-08-10 19:27 [Bug go/101851] New: gccgo crashes compiling `x, y := int(0)` rupert.tombs at gmail dot com
  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
  1 sibling, 0 replies; 3+ messages in thread
From: ian at airs dot com @ 2021-08-11  2:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Ian Lance Taylor <ian at airs dot com> ---
Thanks.  Fixed on mainline.

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

end of thread, other threads:[~2021-08-11  2:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 19:27 [Bug go/101851] New: gccgo crashes compiling `x, y := int(0)` rupert.tombs at gmail dot com
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

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).