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

            Bug ID: 117891
           Summary: go1: internal compiler error: in write_equal_function,
                    at go/gofrontend/types.cc:2334
           Product: gcc
           Version: 14.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: ppysc1115204116 at gmail dot com
  Target Milestone: ---

The following Go code causes an ICE when compiled with the GCC 14.2.0 on
x86_64-linux-gnu. The same code compiles successfully with the GC.

It seems to affect all versions 7.2.x and later. 


$ gccgo -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-install/bin/gccgo
COLLECT_LTO_WRAPPER=/usr/local/gcc-install/libexec/gcc/x86_64-pc-linux-gnu/14.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --prefix=/usr/local/gcc-install
--enable-languages=c,c++,go --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.2.0 (GCC) 
$ 
$ go tool compile gccbug.go
$ 
$ gccgo gccbug.go
go1: internal compiler error: in write_equal_function, at
go/gofrontend/types.cc:2334
0x737bd7 Type::write_equal_function(Gogo*, Named_type*, long, Backend_name
const*, Function_type*)
        ../../gcc/go/gofrontend/types.cc:2334
0x86bf8e Type::build_equal_function(Gogo*, Named_type*, long, Function_type*)
        ../../gcc/go/gofrontend/types.cc:2314
0x87b291 Type::type_descriptor_constructor(Gogo*, int, Named_type*, Methods
const*, bool)
        ../../gcc/go/gofrontend/types.cc:2603
0x87cb58 Array_type::array_type_descriptor(Gogo*, Named_type*)
        ../../gcc/go/gofrontend/types.cc:8241
0x871c43 Type::make_type_descriptor_var(Gogo*)
        ../../gcc/go/gofrontend/types.cc:1387
0x87231d Type::type_descriptor_pointer(Gogo*, Location)
        ../../gcc/go/gofrontend/types.cc:1316
0x7d74ba Array_construction_expression::get_constructor(Translate_context*,
Btype*)
        ../../gcc/go/gofrontend/expressions.cc:17403
0x7ca25a Unary_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:5687
0x7aa2b5 Unsafe_type_conversion_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:4944
0x7aafc3 Slice_value_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:20049
0x7d77e1 Struct_construction_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:17133
0x871da8 Type::make_type_descriptor_var(Gogo*)
        ../../gcc/go/gofrontend/types.cc:1441
0x87231d Type::type_descriptor_pointer(Gogo*, Location)
        ../../gcc/go/gofrontend/types.cc:1316
0x7c275b Type_conversion_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:4733
0x7d77e1 Struct_construction_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:17133
0x7d74ba Array_construction_expression::get_constructor(Translate_context*,
Btype*)
        ../../gcc/go/gofrontend/expressions.cc:17403
0x7ca25a Unary_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:5687
0x7aa2b5 Unsafe_type_conversion_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:4944
0x7aafc3 Slice_value_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:20049
0x7d77e1 Struct_construction_expression::do_get_backend(Translate_context*)
        ../../gcc/go/gofrontend/expressions.cc:17133
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
$ 


--------------------------------------------------------------


package main

type t1 int
type t2 int
type t3 int

func (x *t1) f(y [5]t2) (t1, *t3)

Reply via email to