Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gccgo: new internal compilers errors #2661

Closed
alberts opened this issue Jan 6, 2012 · 10 comments
Closed

gccgo: new internal compilers errors #2661

alberts opened this issue Jan 6, 2012 · 10 comments
Milestone

Comments

@alberts
Copy link
Contributor

@alberts alberts commented Jan 6, 2012

fuzzgc rides again.

What steps will reproduce the problem?

tar -zxvf bork.tar.gz
cd bork
find -mindepth 1 -type d | xargs -n 1 -I DIR sh -c 'echo DIR && cd DIR
&& echo DIR && gccgo -o foo *.go' 2>&1  | grep internal

What do you see instead?

2.go:155:27: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in create_tmp_var, at gimplify.c:477
3.go:36:3: internal compiler error: in gimplify_switch_expr, at gimplify.c:1592
gccgo: internal compiler error: Segmentation fault (program go1)
go1: internal compiler error: in do_check_types, at go/gofrontend/expressions.cc:8371
go1: internal compiler error: in do_get_tree, at go/gofrontend/expressions.cc:11246
go1: internal compiler error: in do_get_tree, at go/gofrontend/expressions.cc:3846
go1: internal compiler error: in do_get_tree, at go/gofrontend/expressions.cc:8620
go1: internal compiler error: in do_get_tree, at go/gofrontend/expressions.cc:9964
go1: internal compiler error: in do_get_tree, at go/gofrontend/expressions.h:924
go1: internal compiler error: in do_lower, at go/gofrontend/statements.cc:1016
go1: internal compiler error: in eval_integer, at go/gofrontend/expressions.cc:4215
go1: internal compiler error: in fill_in_array, at go/go-gcc.cc:560
go1: internal compiler error: in fold_convert_loc, at fold-const.c:1894
go1: internal compiler error: in immutable_struct, at go/go-gcc.cc:1270
go1: internal compiler error: in insert, at go/gofrontend/gogo.cc:5060
go1: internal compiler error: in lower_varargs, at go/gofrontend/expressions.cc:9204
go1: internal compiler error: in result, at go/gofrontend/expressions.cc:9303
go1: internal compiler error: in return_stat, at go/gofrontend/parse.cc:3851
go1: internal compiler error: Segmentation fault
go1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in do_get_tree, at go/gofrontend/expressions.cc:13465
go1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in fold_convert_loc, at fold-const.c:1873
go1: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in ix86_function_type_abi, at config/i386/i386.c:5430

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

gcc version 4.7.0 20120104 (experimental) (GCC)
commit 29e4c389f1bea83cdd82513eb628d471d4bf4924
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@182873
138bc75d-0d04-0410-961f-82ee72b054a4

configured with:

../gccgo/configure --enable-languages=c,c++,go --prefix=/opt/gccgo

Please provide any additional information below.

Built on Fedora 16 x86_64

Attachments:

  1. bork.tar.gz (370478 bytes)
@robpike
Copy link
Contributor

@robpike robpike commented Jan 13, 2012

Comment 1:

Labels changed: added priority-go1.

@robpike
Copy link
Contributor

@robpike robpike commented Jan 13, 2012

Comment 2:

Status changed to Accepted.

@robpike
Copy link
Contributor

@robpike robpike commented Jan 13, 2012

Comment 3:

Owner changed to builder@golang.org.

@alberts
Copy link
Contributor Author

@alberts alberts commented Jan 28, 2012

Comment 4:

Looks like most of these have been fixed. Here's one more that causes a segfault.

Attachments:

  1. tmpB9ecaH.go (51828 bytes)
@remyoudompheng
Copy link
Contributor

@remyoudompheng remyoudompheng commented Jan 31, 2012

Comment 5:

Your example is interesting. After stripping it to make it minimal, I reach an almost
valid program:
package main
var a [2]int
func main() {
      if -a != a {
      }
}
The compiler seems to go in infinite loop and dies from a stack overflow.
@remyoudompheng
Copy link
Contributor

@remyoudompheng remyoudompheng commented Jan 31, 2012

Comment 6:

Even this gives a segfault:
package main
var a, b [1]int
var x = a != -b
@remyoudompheng
Copy link
Contributor

@remyoudompheng remyoudompheng commented Feb 18, 2012

Comment 7:

Ian, after lowering
x = -a == b
the AST is:
 var .go.main.x = (memcmp((pv)(&((tmp.31215264 = -(.go.main.a) )) ) ,(pv)(&(.go.main.b) ) ,typeinfo((AN3_int2e),size ))  == 0)
Why does this pass the typecheck?
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Feb 18, 2012

Comment 8:

Labels changed: added gccgo.

Owner changed to @ianlancetaylor.

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Mar 1, 2012

Comment 9:

For the record, it passes the type check because the type check is never run, due to an
oversight when I introduced Set_and_use_temporary_expression in order to implement array
and struct comparison.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Mar 1, 2012

Comment 10:

These all compile now on tip.  Most of these were compiler crashes on invalid input, but
these tests uncovered some real problems:
* ^int64(0) was miscompiled.
* type T *T; func(t T) { print(*t) } was miscompiled
* a varargs function that called recover was miscompiled
Thanks!

Status changed to Fixed.

@alberts alberts added fixed labels Mar 1, 2012
@rsc rsc added this to the Go1 milestone Apr 10, 2015
@rsc rsc removed the priority-go1 label Apr 10, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.