This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug go/64198] New: ICE in gofrontend


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

            Bug ID: 64198
           Summary: ICE in gofrontend
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: vogt at linux dot vnet.ibm.com
                CC: cmang at google dot com

This test program genererates an ICE with the current gccgo HEAD:

-- snip --
package main
func main() {
        var x int = 0
        println(x++)
}
-- snip --

==>

$ gccgo foo.go
foo.go:4:18: error: missing â)â
         println(x++) 
                  ^
foo.go:4:20: error: expected â;â or â}â or newline
         println(x++) 
                    ^
foo.go:4:9: error: invalid left hand side of assignment
         println(x++) 
         ^
foo.go:4:9: error: expected integer, floating, complex, or string type
go1: internal compiler error: in set_type, at
go/gofrontend/expressions.cc:15374
0x801a5dc9 Numeric_constant::set_type(Type*, bool, Location)
    ../../gcc/go/gofrontend/expressions.cc:15374
0x801a5dc9 Integer_expression::do_check_types(Gogo*)
    ../../gcc/go/gofrontend/expressions.cc:1898
0x801cea8f Expression::check_types(Gogo*)
    ../../gcc/go/gofrontend/expressions.h:717
0x801cea8f Check_types_traverse::expression(Expression**)
    ../../gcc/go/gofrontend/gogo.cc:3094
0x8018d341 Expression::traverse(Expression**, Traverse*)
    ../../gcc/go/gofrontend/expressions.cc:43
0x8018d341 Binary_expression::do_traverse(Traverse*)
    ../../gcc/go/gofrontend/expressions.cc:4304
0x801d4203 Block::traverse(Traverse*)
    ../../gcc/go/gofrontend/gogo.cc:5552
0x801d454d Function::traverse(Traverse*)
    ../../gcc/go/gofrontend/gogo.cc:4707
0x801da7d3 Bindings::traverse(Traverse*, bool)
    ../../gcc/go/gofrontend/gogo.cc:7316
0x801db1cb Gogo::traverse(Traverse*)
    ../../gcc/go/gofrontend/gogo.cc:2353
0x801db1cb Gogo::check_types()
    ../../gcc/go/gofrontend/gogo.cc:3104
0x801ce767 go_parse_input_files(char const**, unsigned int, bool, bool)
    ../../gcc/go/gofrontend/go.cc:107

--

Looks like the gofrontend cannot handle the ++ for call arguments (I don't know
whether Go allows that, but the compiler shouldn't crash anyway).  If the ++ is
placed in a separate statement after the call, the crash goes away.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]