Hi,
I’ve been getting the following error when trying to build Julia (v0.6.2 / v0.6.3 / master):
In file included from /home/chris/Documents/prog/julia-reg/src/codegen.cpp:105:
/home/chris/Documents/prog/julia-reg/src/cgutils.cpp: In function ‘void _hook_call(jl_value_t*, std::array<_jl_value_t*, N>)’:
/home/chris/Documents/prog/julia-reg/src/julia.h:696:55: error: lvalue required as unary ‘&’ operand
jl_pgcstack = (jl_gcframe_t*)&(((void**)rts_var)[-2])
^
/home/chris/Documents/prog/julia-reg/src/cgutils.cpp:112:5: note: in expansion of macro ‘JL_GC_PUSHARGS’
JL_GC_PUSHARGS(argv, N+1);
While using:
$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/9.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --program-suffix=-trunk : (reconfigured) ../gcc-trunk/configure --program-suffix=-trunk --enable-languages=c,c++,fortran,lto,objc --no-create --no-recursion
Thread model: posix
gcc version 9.0.0 20180524 (experimental) (GCC)
The code that produces the error has been the same for ages, and compiles fine under gcc 8.1.0 (the latest release) and earlier.
I’d have to do a lot of digging to find out whether it’s a bug in gcc 9, or that it uncovered an old bug here.
Obviously I can checkout gcc 8.1 again if I just wanted to have Julia, but thought I should post here, in case someone from Julia wants to know, or if I should file a gcc bug report.
For reference, here’s the full output:
$ make CC=gcc-trunk CXX=g++-trunk FC=gfortran-trunk -j32
CC src/codegen.o
In file included from /home/chris/Documents/prog/julia/usr/include/llvm/Target/TargetSubtargetInfo.h:18,
from /home/chris/Documents/prog/julia/src/codegen.cpp:39:
/home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h: In constructor ‘llvm::RegisterScheduler::RegisterScheduler(const char*, const char*, llvm::RegisterScheduler::FunctionPassCtor)’:
/home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h:42:52: warning: cast between incompatible function types from ‘llvm::RegisterScheduler::FunctionPassCtor’ {aka ‘llvm::ScheduleDAGSDNodes* (*)(llvm::SelectionDAGISel*, llvm::CodeGenOpt::Level)’} to ‘llvm::MachinePassCtor’ {aka ‘void* (*)()’} [-Wcast-function-type]
: MachinePassRegistryNode(N, D, (MachinePassCtor)C)
^
In file included from /home/chris/Documents/prog/julia/src/codegen.cpp:120:
/home/chris/Documents/prog/julia/src/cgutils.cpp: In function ‘void _hook_call(jl_value_t*, std::array<_jl_value_t*, N>)’:
/home/chris/Documents/prog/julia/src/julia.h:627:55: error: lvalue required as unary ‘&’ operand
jl_pgcstack = (jl_gcframe_t*)&(((void**)rts_var)[-2])
^
/home/chris/Documents/prog/julia/src/cgutils.cpp:50:5: note: in expansion of macro ‘JL_GC_PUSHARGS’
JL_GC_PUSHARGS(argv, N+1);
^~~~~~~~~~~~~~
In file included from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Allocator.h:24,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/StringMap.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Host.h:17,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/Hashing.h:49,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/ArrayRef.h:13,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/CommandLine.h:23,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/MachinePassRegistry.h:22,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Target/TargetSubtargetInfo.h:18,
from /home/chris/Documents/prog/julia/src/codegen.cpp:39:
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h: In instantiation of ‘void llvm::SmallVectorTemplateBase<T, true>::push_back(const T&) [with T = std::pair<std::pair<llvm::MCSection*, const llvm::MCExpr*>, std::pair<llvm::MCSection*, const llvm::MCExpr*> >]’:
/home/chris/Documents/prog/julia/usr/include/llvm/MC/MCStreamer.h:321:66: required from here
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:305:11: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<std::pair<llvm::MCSection*, const llvm::MCExpr*>, std::pair<llvm::MCSection*, const llvm::MCExpr*> >’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(this->end(), &Elt, sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/9.0.0/bits/stl_algobase.h:64,
from /usr/local/include/c++/9.0.0/bits/char_traits.h:39,
from /usr/local/include/c++/9.0.0/string:40,
from /home/chris/Documents/prog/julia/src/codegen.cpp:26:
/usr/local/include/c++/9.0.0/bits/stl_pair.h:198:12: note: ‘struct std::pair<std::pair<llvm::MCSection*, const llvm::MCExpr*>, std::pair<llvm::MCSection*, const llvm::MCExpr*> >’ declared here
struct pair
^~~~
In file included from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Allocator.h:24,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/StringMap.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Host.h:17,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/Hashing.h:49,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/ArrayRef.h:13,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/CommandLine.h:23,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/MachinePassRegistry.h:22,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Target/TargetSubtargetInfo.h:18,
from /home/chris/Documents/prog/julia/src/codegen.cpp:39:
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h: In instantiation of ‘void llvm::SmallVectorTemplateBase<T, true>::push_back(const T&) [with T = std::pair<_jl_value_t**, llvm::GlobalVariable*>]’:
/home/chris/Documents/prog/julia/src/codegen.cpp:6331:53: required from here
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:305:11: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<_jl_value_t**, llvm::GlobalVariable*>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(this->end(), &Elt, sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/9.0.0/bits/stl_algobase.h:64,
from /usr/local/include/c++/9.0.0/bits/char_traits.h:39,
from /usr/local/include/c++/9.0.0/string:40,
from /home/chris/Documents/prog/julia/src/codegen.cpp:26:
/usr/local/include/c++/9.0.0/bits/stl_pair.h:198:12: note: ‘struct std::pair<_jl_value_t**, llvm::GlobalVariable*>’ declared here
struct pair
^~~~
In file included from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Allocator.h:24,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/StringMap.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Host.h:17,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/Hashing.h:49,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/ArrayRef.h:13,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/CommandLine.h:23,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/MachinePassRegistry.h:22,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Target/TargetSubtargetInfo.h:18,
from /home/chris/Documents/prog/julia/src/codegen.cpp:39:
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h: In instantiation of ‘void llvm::SmallVectorTemplateBase<T, true>::push_back(const T&) [with T = std::pair<void*, long unsigned int>]’:
/home/chris/Documents/prog/julia/usr/include/llvm/Support/Allocator.h:238:33: required from ‘void* llvm::BumpPtrAllocatorImpl<AllocatorT, SlabSize, SizeThreshold>::Allocate(size_t, size_t) [with AllocatorT = llvm::MallocAllocator; long unsigned int SlabSize = 4096; long unsigned int SizeThreshold = 4096; size_t = long unsigned int]’
/home/chris/Documents/prog/julia/usr/include/llvm/MC/MCContext.h:575:44: required from here
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:305:11: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<void*, long unsigned int>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(this->end(), &Elt, sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/9.0.0/bits/stl_algobase.h:64,
from /usr/local/include/c++/9.0.0/bits/char_traits.h:39,
from /usr/local/include/c++/9.0.0/string:40,
from /home/chris/Documents/prog/julia/src/codegen.cpp:26:
/usr/local/include/c++/9.0.0/bits/stl_pair.h:198:12: note: ‘struct std::pair<void*, long unsigned int>’ declared here
struct pair
^~~~
In file included from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Allocator.h:24,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/StringMap.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/Host.h:17,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/Hashing.h:49,
from /home/chris/Documents/prog/julia/usr/include/llvm/ADT/ArrayRef.h:13,
from /home/chris/Documents/prog/julia/usr/include/llvm/Support/CommandLine.h:23,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/MachinePassRegistry.h:22,
from /home/chris/Documents/prog/julia/usr/include/llvm/CodeGen/SchedulerRegistry.h:18,
from /home/chris/Documents/prog/julia/usr/include/llvm/Target/TargetSubtargetInfo.h:18,
from /home/chris/Documents/prog/julia/src/codegen.cpp:39:
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h: In instantiation of ‘static void llvm::SmallVectorTemplateBase<T, true>::uninitialized_copy(T1*, T1*, T2*, typename std::enable_if<std::is_same<typename std::remove_const<T1>::type, T2>::value>::type*) [with T1 = const std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>; T2 = std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>; T = std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>; typename std::enable_if<std::is_same<typename std::remove_const<T1>::type, T2>::value>::type = void]’:
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:396:5: required from ‘void llvm::SmallVectorImpl<T>::append(in_iter, in_iter) [with in_iter = const std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>*; T = std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>]’
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:855:5: required from ‘llvm::SmallVector<T, N>::SmallVector(ItTy, ItTy) [with ItTy = const std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>*; T = std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>; unsigned int N = 2]’
/home/chris/Documents/prog/julia/usr/include/llvm/MC/MCFragment.h:547:42: required from here
/home/chris/Documents/prog/julia/usr/include/llvm/ADT/SmallVector.h:293:13: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘struct std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]
memcpy(Dest, I, (E - I) * sizeof(T));
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/c++/9.0.0/bits/stl_algobase.h:64,
from /usr/local/include/c++/9.0.0/bits/char_traits.h:39,
from /usr/local/include/c++/9.0.0/string:40,
from /home/chris/Documents/prog/julia/src/codegen.cpp:26:
/usr/local/include/c++/9.0.0/bits/stl_pair.h:198:12: note: ‘struct std::pair<const llvm::MCSymbol*, const llvm::MCSymbol*>’ declared here
struct pair
^~~~
Makefile:144: recipe for target 'codegen.o' failed
make[1]: *** [codegen.o] Error 1
Makefile:94: recipe for target 'julia-src-release' failed
make: *** [julia-src-release] Error 2