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

            Bug ID: 89321
           Summary: cross build with riscv64 gccgo compilation failed due
                    to assert in constructor_expression
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: sean.wang at wdc dot com
                CC: cmang at google dot com
  Target Milestone: ---

* Built cross toolchain for riscv64 via gcc master branch commit hash
<4426330625ecc522a5214a990d88a68dc197b15f>

* glibc from 2.28 release branch

* Go build command: 
 /usr/local/go/bin/go/bin/go [build -o /artifacts/xxxxxx/ -compiler gccgo -v
-work -x -gccgoflags -w -s -g3 -X main.gitHash=xxx -g3 -X main.g
tUnixTime=0 -extldflags "-static -Wl,--no-export-dynamic" ./xxx]
WORK=/tmp/go-build855483278

* gccgo command:
 /scratch/cross-gccgo/tools/bin/gccgo -c -g
-fgo-pkgpath=xxxx/xxx/xxx/internal/xxx-o $WORK/b296/_go_.o -I
$WORK/b296/_importcfgroot_ ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go
./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go
./xxx.go ./xxx.go ./xxx.go ./xxx.g\
o ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go ./xxx.go
./xxx.go

* gccgo compilation warning:
 /deps/riscv64/include/libavutil/mem.h:186:1: warning: 'allg: 'alloc_size'
attribute ignored on a function returning[-Wattributes]
   186 | av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb,
size_t size);
       | ^~~~~~~~~~~~~

* gccgo internal compiler error:
--BEGIN--
# xxxx/xx/xxx/internal/xxx
        go1: internal compiler error: in constructor_expression, at
go/go-gcc.cc:1811
        0x638fb5 Gcc_backend::constructor_expression(Btype*,
std::vector<Bexpression*, std::allocator<Bexpression*> > const&, Location)
                /scratch/cross-gccgo/src/gcc/gcc/go/go-gcc.cc:1811
        0x6265de
Struct_construction_expression::do_get_backend(Translate_context*)
               
/scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/expressions.cc:13091
        0x628393
Array_construction_expression::get_constructor(Translate_context*, Btype*)
               
/scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/expressions.cc:13315
        0x68dff2 Temporary_statement::do_get_backend(Translate_context*)
               
/scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/statements.cc:548
        0x64f7ad Block::get_backend(Translate_context*)
                /scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/gogo.cc:6666
        0x689fac Block_statement::do_get_backend(Translate_context*)
               
/scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/statements.cc:1860
        0x64f7ad Block::get_backend(Translate_context*)
                /scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/gogo.cc:6666
        0x652b4e Function::build(Gogo*, Named_object*)
                /scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/gogo.cc:6141
        0x65377b Named_object::get_backend(Gogo*, std::vector<Bexpression*,
std::allocator<Bexpression*> >&, std::vector<Btype*, std::allocator<Btype*> >&,
std::vector<Bfunction*, std::allocator<Bf\
unction*> >&)
                /scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/gogo.cc:8228
        0x65beb1 Gogo::write_globals()
                /scratch/cross-gccgo/src/gcc/gcc/go/gofrontend/gogo.cc:1443
        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.
--END --

Reply via email to